Class: Kumi::Core::NAST::Ref

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

Methods inherited from Node

#children, #each_child

Constructor Details

#initialize(name:, **k) ⇒ Ref

Returns a new instance of Ref.



67
68
69
70
# File 'lib/kumi/core/nast.rb', line 67

def initialize(name:, **k)
  super(**k)
  @name = name.to_sym
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



65
66
67
# File 'lib/kumi/core/nast.rb', line 65

def name
  @name
end

Instance Method Details

#accept(visitor) ⇒ Object



72
73
74
# File 'lib/kumi/core/nast.rb', line 72

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