Class: Kumi::Core::NAST::Pair

Inherits:
Node
  • Object
show all
Defined in:
lib/kumi/core/nast.rb

Instance Attribute Summary collapse

Attributes inherited from Node

#id, #loc, #meta

Instance Method Summary collapse

Constructor Details

#initialize(key:, value:, **k) ⇒ Pair

Returns a new instance of Pair.



136
137
138
139
140
# File 'lib/kumi/core/nast.rb', line 136

def initialize(key:, value:, **k)
  super(**k)
  @key = key
  @value = value
end

Instance Attribute Details

#keyObject (readonly)

Returns the value of attribute key.



134
135
136
# File 'lib/kumi/core/nast.rb', line 134

def key
  @key
end

#valueObject (readonly)

Returns the value of attribute value.



134
135
136
# File 'lib/kumi/core/nast.rb', line 134

def value
  @value
end

Instance Method Details

#accept(visitor) ⇒ Object



142
143
144
# File 'lib/kumi/core/nast.rb', line 142

def accept(visitor)
  visitor.visit_pair(self)
end