Class: Lisp::Binding

Inherits:
Object show all
Defined in:
lib/rubylisp/binding.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(symbol, value) ⇒ Binding

Returns a new instance of Binding.



6
7
8
9
10
# File 'lib/rubylisp/binding.rb', line 6

def initialize(symbol, value)
  @symbol = symbol
  @value = value
  self
end

Instance Attribute Details

#symbolObject

Returns the value of attribute symbol.



4
5
6
# File 'lib/rubylisp/binding.rb', line 4

def symbol
  @symbol
end

#valueObject

Returns the value of attribute value.



4
5
6
# File 'lib/rubylisp/binding.rb', line 4

def value
  @value
end

Instance Method Details

#to_sObject



12
13
14
# File 'lib/rubylisp/binding.rb', line 12

def to_s
  "#{symbol.name} -> #{value.to_s}"
end