Class: LibRubyParser::Nodes::IfTernary
- Inherits:
-
LibRubyParser::Node
- Object
- LibRubyParser::Node
- LibRubyParser::Nodes::IfTernary
- Defined in:
- lib/lib-ruby-parser/nodes.rb
Overview
Represents ternary if
statement (i.e. cond ? if_true : if_false
)
Instance Attribute Summary collapse
-
#colon_l ⇒ Loc
readonly
Location of the
:
operator. -
#cond ⇒ Node
readonly
Condition of the
if
statement. -
#expression_l ⇒ Loc
readonly
Location of the full expression.
-
#if_false ⇒ Node
readonly
True-branch.
-
#if_true ⇒ Node
readonly
True-branch.
-
#question_l ⇒ Loc
readonly
Location of the
?
operator.
Instance Attribute Details
#colon_l ⇒ Loc (readonly)
Location of the :
operator
cond ? if_true : if_false
~
1980 1981 1982 |
# File 'lib/lib-ruby-parser/nodes.rb', line 1980 def colon_l @colon_l end |
#cond ⇒ Node (readonly)
Condition of the if
statement
1954 1955 1956 |
# File 'lib/lib-ruby-parser/nodes.rb', line 1954 def cond @cond end |
#expression_l ⇒ Loc (readonly)
Location of the full expression
cond ? if_true : if_false
~~~~~~~~~~~~~~~~~~~~~~~~~
1989 1990 1991 |
# File 'lib/lib-ruby-parser/nodes.rb', line 1989 def expression_l @expression_l end |
#if_false ⇒ Node (readonly)
True-branch
1962 1963 1964 |
# File 'lib/lib-ruby-parser/nodes.rb', line 1962 def if_false @if_false end |
#if_true ⇒ Node (readonly)
True-branch
1958 1959 1960 |
# File 'lib/lib-ruby-parser/nodes.rb', line 1958 def if_true @if_true end |
#question_l ⇒ Loc (readonly)
Location of the ?
operator
cond ? if_true : if_false
~
1971 1972 1973 |
# File 'lib/lib-ruby-parser/nodes.rb', line 1971 def question_l @question_l end |