Class: Reference

Inherits:
Object show all
Defined in:
lib/failirc/extensions.rb

Instance Method Summary collapse

Constructor Details

#initialize(name, vars) ⇒ Reference

Returns a new instance of Reference.



24
25
26
27
# File 'lib/failirc/extensions.rb', line 24

def initialize (name, vars)
    @getter = eval "lambda { #{name} }", vars
    @setter = eval "lambda { |v| #{name} = v }", vars
end

Instance Method Details

#valueObject



29
30
31
# File 'lib/failirc/extensions.rb', line 29

def value
    @getter.call
end

#value=(newValue) ⇒ Object



33
34
35
# File 'lib/failirc/extensions.rb', line 33

def value= (newValue)
    @setter.call(newValue)    
end