Class: LibRubyParser::Nodes::When
- Inherits:
-
LibRubyParser::Node
- Object
- LibRubyParser::Node
- LibRubyParser::Nodes::When
- Defined in:
- lib/lib-ruby-parser/nodes.rb
Overview
Represents a branch of the case
statement (i.e. when foo
)
Instance Attribute Summary collapse
-
#begin_l ⇒ Loc
readonly
Location of the
then
keyword. -
#body ⇒ Node?
readonly
Body of the
when
branch. -
#expression_l ⇒ Loc
readonly
Location of the full expression.
-
#keyword_l ⇒ Loc
readonly
Location of the
when
keyword. -
#patterns ⇒ ::Array<Node>
readonly
A list of values to compare/match against.
Instance Attribute Details
#begin_l ⇒ Loc (readonly)
Location of the then
keyword
case foo; when bar then baz; end
~~~~
then
is optional, and so begin_l
can be None
4193 4194 4195 |
# File 'lib/lib-ruby-parser/nodes.rb', line 4193 def begin_l @begin_l end |
#body ⇒ Node? (readonly)
Body of the when
branch
4173 4174 4175 |
# File 'lib/lib-ruby-parser/nodes.rb', line 4173 def body @body end |
#expression_l ⇒ Loc (readonly)
Location of the full expression
case foo; when bar then baz; end
~~~~~~~~~~~~~~~~~
4202 4203 4204 |
# File 'lib/lib-ruby-parser/nodes.rb', line 4202 def expression_l @expression_l end |
#keyword_l ⇒ Loc (readonly)
Location of the when
keyword
case foo; when bar; end
~~~~
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
4169 4170 4171 |
# File 'lib/lib-ruby-parser/nodes.rb', line 4169 def patterns @patterns end |