Class: LibRubyParser::Nodes::IfMod

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

Overview

Represents an if/unless modifier (i.e. stmt if cond)

Instance Attribute Summary collapse

Instance Attribute Details

#condNode (readonly)

Condition of the modifier

Returns:



1908
1909
1910
# File 'lib/lib-ruby-parser/nodes.rb', line 1908

def cond
  @cond
end

#expression_lLoc (readonly)

Location of the full expression

stmt if cond
~~~~~~~~~~~~

stmt unless cond
~~~~~~~~~~~~~~~~

Returns:



1946
1947
1948
# File 'lib/lib-ruby-parser/nodes.rb', line 1946

def expression_l
  @expression_l
end

#if_falseNode? (readonly)

False-branch of the modifier.

Always set for unless modifier. Always None for if modifier.

Returns:



1922
1923
1924
# File 'lib/lib-ruby-parser/nodes.rb', line 1922

def if_false
  @if_false
end

#if_trueNode? (readonly)

True-branch of the modifier.

Always set for if modifier. Always None for unless modifier.

Returns:



1915
1916
1917
# File 'lib/lib-ruby-parser/nodes.rb', line 1915

def if_true
  @if_true
end

#keyword_lLoc (readonly)

Location of the if/unless keyword

stmt if cond
     ~~

stmt unless cond
     ~~~~~~

Returns:



1934
1935
1936
# File 'lib/lib-ruby-parser/nodes.rb', line 1934

def keyword_l
  @keyword_l
end