Class: Refract::AssocNode
Instance Attribute Summary collapse
-
#key ⇒ Object
Returns the value of attribute key.
-
#value ⇒ Object
Returns the value of attribute value.
Instance Method Summary collapse
-
#initialize(prism_node: nil, key:, value:) ⇒ AssocNode
constructor
A new instance of AssocNode.
Methods inherited from Node
#accept, #copy, #start_line, #type, type
Constructor Details
#initialize(prism_node: nil, key:, value:) ⇒ AssocNode
Returns a new instance of AssocNode.
5 6 7 8 9 10 |
# File 'lib/refract/nodes/assoc_node.rb', line 5 def initialize(prism_node: nil, key:, value:) @prism_node = prism_node => Prism::Node | nil @key = key @value = value freeze end |
Instance Attribute Details
#key ⇒ Object
Returns the value of attribute key.
12 13 14 |
# File 'lib/refract/nodes/assoc_node.rb', line 12 def key @key end |
#value ⇒ Object
Returns the value of attribute value.
12 13 14 |
# File 'lib/refract/nodes/assoc_node.rb', line 12 def value @value end |