Class: LibRubyParser::Nodes::IfTernary

Inherits:
LibRubyParser::Node show all
Defined in:
lib/lib-ruby-parser/nodes.rb

Overview

Represents ternary if statement (i.e. cond ? if_true : if_false)

Instance Attribute Summary collapse

Instance Attribute Details

#colon_lLoc (readonly)

Location of the : operator

cond ? if_true : if_false
               ~

Returns:



1980
1981
1982
# File 'lib/lib-ruby-parser/nodes.rb', line 1980

def colon_l
  @colon_l
end

#condNode (readonly)

Condition of the if statement

Returns:



1954
1955
1956
# File 'lib/lib-ruby-parser/nodes.rb', line 1954

def cond
  @cond
end

#expression_lLoc (readonly)

Location of the full expression

cond ? if_true : if_false
~~~~~~~~~~~~~~~~~~~~~~~~~

Returns:



1989
1990
1991
# File 'lib/lib-ruby-parser/nodes.rb', line 1989

def expression_l
  @expression_l
end

#if_falseNode (readonly)

True-branch

Returns:



1962
1963
1964
# File 'lib/lib-ruby-parser/nodes.rb', line 1962

def if_false
  @if_false
end

#if_trueNode (readonly)

True-branch

Returns:



1958
1959
1960
# File 'lib/lib-ruby-parser/nodes.rb', line 1958

def if_true
  @if_true
end

#question_lLoc (readonly)

Location of the ? operator

cond ? if_true : if_false
     ~

Returns:



1971
1972
1973
# File 'lib/lib-ruby-parser/nodes.rb', line 1971

def question_l
  @question_l
end