Class: LibRubyParser::Nodes::IfMod
- Inherits:
-
LibRubyParser::Node
- Object
- LibRubyParser::Node
- LibRubyParser::Nodes::IfMod
- Defined in:
- lib/lib-ruby-parser/nodes.rb
Overview
Represents an if
/unless
modifier (i.e. stmt if cond
)
Instance Attribute Summary collapse
-
#cond ⇒ Node
readonly
Condition of the modifier.
-
#expression_l ⇒ Loc
readonly
Location of the full expression.
-
#if_false ⇒ Node?
readonly
False-branch of the modifier.
-
#if_true ⇒ Node?
readonly
True-branch of the modifier.
-
#keyword_l ⇒ Loc
readonly
Location of the
if
/unless
keyword.
Instance Attribute Details
#cond ⇒ Node (readonly)
Condition of the modifier
1908 1909 1910 |
# File 'lib/lib-ruby-parser/nodes.rb', line 1908 def cond @cond end |
#expression_l ⇒ Loc (readonly)
Location of the full expression
stmt if cond
~~~~~~~~~~~~
stmt unless cond
~~~~~~~~~~~~~~~~
1946 1947 1948 |
# File 'lib/lib-ruby-parser/nodes.rb', line 1946 def expression_l @expression_l end |
#if_false ⇒ Node? (readonly)
False-branch of the modifier.
Always set for unless
modifier.
Always None
for if
modifier.
1922 1923 1924 |
# File 'lib/lib-ruby-parser/nodes.rb', line 1922 def if_false @if_false end |
#if_true ⇒ Node? (readonly)
True-branch of the modifier.
Always set for if
modifier.
Always None
for unless
modifier.
1915 1916 1917 |
# File 'lib/lib-ruby-parser/nodes.rb', line 1915 def if_true @if_true end |
#keyword_l ⇒ Loc (readonly)
Location of the if
/unless
keyword
stmt if cond
~~
stmt unless cond
~~~~~~
1934 1935 1936 |
# File 'lib/lib-ruby-parser/nodes.rb', line 1934 def keyword_l @keyword_l end |