Class: LibRubyParser::Nodes::MatchVar
- Inherits:
-
LibRubyParser::Node
- Object
- LibRubyParser::Node
- LibRubyParser::Nodes::MatchVar
- Defined in:
- lib/lib-ruby-parser/nodes.rb
Overview
Represents matching with assignment into a local variable (i.e. pattern => var
)
Instance Attribute Summary collapse
-
#expression_l ⇒ Loc
readonly
Location of the full expression.
-
#name ⇒ String
readonly
Name of the variable that is assigned if matching succeeds.
-
#name_l ⇒ Loc
readonly
Location of the name.
Instance Attribute Details
#expression_l ⇒ Loc (readonly)
Location of the full expression
case foo; in pattern => bar; end
~~~
Note it can also be produced by a hash pattern
case foo; in { a: }; end
~~
2833 2834 2835 |
# File 'lib/lib-ruby-parser/nodes.rb', line 2833 def expression_l @expression_l end |
#name ⇒ String (readonly)
Name of the variable that is assigned if matching succeeds
2801 2802 2803 |
# File 'lib/lib-ruby-parser/nodes.rb', line 2801 def name @name end |
#name_l ⇒ Loc (readonly)
Location of the name
case foo; in pattern => bar; end
~~~
Note it can also be produced by a hash pattern
case foo; in { a: }; end
~
2817 2818 2819 |
# File 'lib/lib-ruby-parser/nodes.rb', line 2817 def name_l @name_l end |