Class: Rampi::Var

Inherits:
Node
  • Object
show all
Defined in:
lib/rampi/node.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Node

#!=, #%, #&, #*, #**, #+, #-, #-@, #/, #<, #<<, #<=, #==, #>, #>=, #>>, #^, #|, #~

Constructor Details

#initialize(name) ⇒ Var

Returns a new instance of Var.



86
87
88
# File 'lib/rampi/node.rb', line 86

def initialize(name)
  @name = name
end

Instance Attribute Details

#nameObject

Returns the value of attribute name.



84
85
86
# File 'lib/rampi/node.rb', line 84

def name
  @name
end

Instance Method Details

#accept(visitor) ⇒ Object



95
96
97
# File 'lib/rampi/node.rb', line 95

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

#to_sObject Also known as: inspect



90
91
92
# File 'lib/rampi/node.rb', line 90

def to_s
  name.to_s
end