Hi,
The following code works, but I was wondering if the creation of the @obj
instance variable is really necessary?
class A
def callback(name, obj)
@obj = obj
eval("def #{name}; @obj.keys; end")
end
end
class B
attr_reader :keys
def initialize(k, cb)
@keys = k
cb.callback('cassette', self)
end
end
a = A.new
g = B.new([1,2,3], a)
puts a.cassette