Class: LibRubyParser::Nodes::When

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

Overview

Represents a branch of the case statement (i.e. when foo)

Instance Attribute Summary collapse

Instance Attribute Details

#begin_lLoc (readonly)

Location of the then keyword

case foo; when bar then baz; end
                   ~~~~

then is optional, and so begin_l can be None

Returns:



4193
4194
4195
# File 'lib/lib-ruby-parser/nodes.rb', line 4193

def begin_l
  @begin_l
end

#bodyNode? (readonly)

Body of the when branch

Returns:



4173
4174
4175
# File 'lib/lib-ruby-parser/nodes.rb', line 4173

def body
  @body
end

#expression_lLoc (readonly)

Location of the full expression

case foo; when bar then baz; end
          ~~~~~~~~~~~~~~~~~

Returns:



4202
4203
4204
# File 'lib/lib-ruby-parser/nodes.rb', line 4202

def expression_l
  @expression_l
end

#keyword_lLoc (readonly)

Location of the when keyword

case foo; when bar; end
          ~~~~

Returns:



4182
4183
4184
# File 'lib/lib-ruby-parser/nodes.rb', line 4182

def keyword_l
  @keyword_l
end

#patterns::Array<Node> (readonly)

A list of values to compare/match against

Returns:



4169
4170
4171
# File 'lib/lib-ruby-parser/nodes.rb', line 4169

def patterns
  @patterns
end