Class: Potter::AST::Node

Inherits:
Object
  • Object
show all
Defined in:
lib/potter/ast/node.rb

Direct Known Subclasses

Binary, Unary, Value, Variable

Instance Method Summary collapse

Instance Method Details

#eql?(o) ⇒ Boolean

Returns:

  • (Boolean)


13
14
15
# File 'lib/potter/ast/node.rb', line 13

def eql?(o)
  hash == o.hash
end

#hashObject



11
# File 'lib/potter/ast/node.rb', line 11

def hash = [self.class, *instance_variable_values].hash

#nameObject



5
# File 'lib/potter/ast/node.rb', line 5

def name   = NAME

#symbolObject



4
# File 'lib/potter/ast/node.rb', line 4

def symbol = SYMBOL

#visit(visitor) ⇒ Object



7
8
9
# File 'lib/potter/ast/node.rb', line 7

def visit(visitor)
  visitor.try(name, self)
end