Class: LibRubyParser::Nodes::HashPattern

Inherits:
LibRubyParser::Node show all
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

Instance Attribute Details

#begin_lLoc? (readonly)

Location of the open parenthesis

case foo; in { a: 1 }; end
             ~

None if there are no parentheses

Returns:



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

Returns:



1702
1703
1704
# File 'lib/lib-ruby-parser/nodes.rb', line 1702

def elements
  @elements
end

#end_lLoc? (readonly)

Location of the open parenthesis

case foo; in { a: 1 }; end
                    ~

None if there are no parentheses

Returns:



1724
1725
1726
# File 'lib/lib-ruby-parser/nodes.rb', line 1724

def end_l
  @end_l
end

#expression_lLoc (readonly)

Location of the full expression

case foo; in { a: 1 }; end
             ~~~~~~~~

Returns:



1733
1734
1735
# File 'lib/lib-ruby-parser/nodes.rb', line 1733

def expression_l
  @expression_l
end