Class: LibRubyParser::Nodes::Pair

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

Overview

Represents a key/value pair (e.g. a part of the Hash node)

Instance Attribute Summary collapse

Instance Attribute Details

#expression_lLoc (readonly)

Location of the full expression

{ foo: bar }
  ~~~~~~~~

{ :foo => bar }
  ~~~~~~~~~~~

Returns:



3224
3225
3226
# File 'lib/lib-ruby-parser/nodes.rb', line 3224

def expression_l
  @expression_l
end

#keyNode (readonly)

Key of the pair

Returns:



3196
3197
3198
# File 'lib/lib-ruby-parser/nodes.rb', line 3196

def key
  @key
end

#operator_lLoc (readonly)

Location of the : or => operator

{ foo: bar }
     ~

{ :foo => bar }
       ~~

Returns:



3212
3213
3214
# File 'lib/lib-ruby-parser/nodes.rb', line 3212

def operator_l
  @operator_l
end

#valueNode (readonly)

Value of the pair

Returns:



3200
3201
3202
# File 'lib/lib-ruby-parser/nodes.rb', line 3200

def value
  @value
end