Class: LibRubyParser::Nodes::HashPattern
- Inherits:
-
LibRubyParser::Node
- Object
- LibRubyParser::Node
- LibRubyParser::Nodes::HashPattern
- Defined in:
- lib/lib-ruby-parser/nodes.rb
Overview
Represents a hash pattern used in pattern matching (i.e. in { a: 1 }
)
Instance Attribute Summary collapse
-
#begin_l ⇒ Loc?
readonly
Location of the open parenthesis.
-
#elements ⇒ ::Array<Node>
readonly
A list of inner patterns.
-
#end_l ⇒ Loc?
readonly
Location of the open parenthesis.
-
#expression_l ⇒ Loc
readonly
Location of the full expression.
Instance Attribute Details
#begin_l ⇒ Loc? (readonly)
Location of the open parenthesis
case foo; in { a: 1 }; end
~
None
if there are no parentheses
1713 1714 1715 |
# File 'lib/lib-ruby-parser/nodes.rb', line 1713 def begin_l @begin_l end |
#elements ⇒ ::Array<Node> (readonly)
A list of inner patterns
1702 1703 1704 |
# File 'lib/lib-ruby-parser/nodes.rb', line 1702 def elements @elements end |
#end_l ⇒ Loc? (readonly)
Location of the open parenthesis
case foo; in { a: 1 }; end
~
None
if there are no parentheses
1724 1725 1726 |
# File 'lib/lib-ruby-parser/nodes.rb', line 1724 def end_l @end_l end |
#expression_l ⇒ Loc (readonly)
Location of the full expression
case foo; in { a: 1 }; end
~~~~~~~~
1733 1734 1735 |
# File 'lib/lib-ruby-parser/nodes.rb', line 1733 def expression_l @expression_l end |