Class: LibRubyParser::Nodes::Pair
- Inherits:
-
LibRubyParser::Node
- Object
- LibRubyParser::Node
- LibRubyParser::Nodes::Pair
- 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
-
#expression_l ⇒ Loc
readonly
Location of the full expression.
-
#key ⇒ Node
readonly
Key of the pair.
-
#operator_l ⇒ Loc
readonly
Location of the
:
or=>
operator. -
#value ⇒ Node
readonly
Value of the pair.
Instance Attribute Details
#expression_l ⇒ Loc (readonly)
Location of the full expression
{ foo: bar }
~~~~~~~~
{ :foo => bar }
~~~~~~~~~~~
3224 3225 3226 |
# File 'lib/lib-ruby-parser/nodes.rb', line 3224 def expression_l @expression_l end |
#key ⇒ Node (readonly)
Key of the pair
3196 3197 3198 |
# File 'lib/lib-ruby-parser/nodes.rb', line 3196 def key @key end |
#operator_l ⇒ Loc (readonly)
Location of the :
or =>
operator
{ foo: bar }
~
{ :foo => bar }
~~
3212 3213 3214 |
# File 'lib/lib-ruby-parser/nodes.rb', line 3212 def operator_l @operator_l end |
#value ⇒ Node (readonly)
Value of the pair
3200 3201 3202 |
# File 'lib/lib-ruby-parser/nodes.rb', line 3200 def value @value end |