Class: Kumi::Core::NAST::Pair
Instance Attribute Summary collapse
-
#key ⇒ Object
readonly
Returns the value of attribute key.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Attributes inherited from Node
Instance Method Summary collapse
- #accept(visitor) ⇒ Object
- #children ⇒ Object
-
#initialize(key:, value:, **k) ⇒ Pair
constructor
A new instance of Pair.
Methods inherited from Node
Constructor Details
#initialize(key:, value:, **k) ⇒ Pair
Returns a new instance of Pair.
146 147 148 149 150 |
# File 'lib/kumi/core/nast.rb', line 146 def initialize(key:, value:, **k) super(**k) @key = key @value = value end |
Instance Attribute Details
#key ⇒ Object (readonly)
Returns the value of attribute key.
144 145 146 |
# File 'lib/kumi/core/nast.rb', line 144 def key @key end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
144 145 146 |
# File 'lib/kumi/core/nast.rb', line 144 def value @value end |
Instance Method Details
#accept(visitor) ⇒ Object
152 153 154 |
# File 'lib/kumi/core/nast.rb', line 152 def accept(visitor) visitor.visit_pair(self) end |
#children ⇒ Object
156 |
# File 'lib/kumi/core/nast.rb', line 156 def children = [key, value].grep(Node) |