D
David Gurba
Hello Everyone,
I'm new to Ruby and some of its features...
I want to do the following (with as little modfication as necessary):
call a passed block to a function at some later time... Eg.
class A
def foo(&block)
@func = block
end
end
a = A.new
num = a.func.call { print "12" }
...but func is an unknown method, and attr_accessor :func doesn't help either....
any nice solution?
David G.
I'm new to Ruby and some of its features...
I want to do the following (with as little modfication as necessary):
call a passed block to a function at some later time... Eg.
class A
def foo(&block)
@func = block
end
end
a = A.new
num = a.func.call { print "12" }
...but func is an unknown method, and attr_accessor :func doesn't help either....
any nice solution?
David G.