T
Trans
Is there any way to change the binding of a proc? I'm defining a proc
on the class level but I want to bind it to the instance level, eg.
class X
attr :s
dsl proc{ s+1 }, proc{ s+2 }
end
I'm able to turn the proc into an instance method, then capture the
UnboundMethod, then undefine it, then bind it to the instance in order
to call it, but that sure seems like a hek of a round about way to have
to do things.
Any better solutions?
Thanks,
T.
on the class level but I want to bind it to the instance level, eg.
class X
attr :s
dsl proc{ s+1 }, proc{ s+2 }
end
I'm able to turn the proc into an instance method, then capture the
UnboundMethod, then undefine it, then bind it to the instance in order
to call it, but that sure seems like a hek of a round about way to have
to do things.
Any better solutions?
Thanks,
T.