Class: LibRubyParser::Nodes::Hash

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

Overview

Represents a hash literal (i.e. ‘{ foo: 42 }`)

Instance Attribute Summary collapse

Instance Attribute Details

#begin_lLoc? (readonly)

Location of the open parenthesis

“‘text { a: 1 } ~ “`

None if hash literal is implicit, e.g. ‘foo(key: “value”)`

Returns:



1674
1675
1676
# File 'lib/lib-ruby-parser/nodes.rb', line 1674

def begin_l
  @begin_l
end

#end_lLoc? (readonly)

Location of the closing parenthesis

“‘text { a: 1 }

~

“‘

None if hash literal is implicit, e.g. ‘foo(key: “value”)`

Returns:



1685
1686
1687
# File 'lib/lib-ruby-parser/nodes.rb', line 1685

def end_l
  @end_l
end

#expression_lLoc (readonly)

Location of the full expression

“‘text { a: 1 } ~~~~~~~~ “`

Returns:



1694
1695
1696
# File 'lib/lib-ruby-parser/nodes.rb', line 1694

def expression_l
  @expression_l
end

#pairs::Array<Node> (readonly)

A list of key-value pairs

Returns:



1663
1664
1665
# File 'lib/lib-ruby-parser/nodes.rb', line 1663

def pairs
  @pairs
end