Re: Question about BlankSlate.reveal


#1

On Sun, Jan 25, 2009 at 5:30 AM, Gregory B.
removed_email_address@domain.invalid wrote:

As it turns out, I was able to stop the method from binding to a
single instance without re-binding on every call. I simply changed
this code:

   bound_method.call(*args)
 end

end
end

So that instead, it passed the UnboundMethod directly to
define_method. This does what I want and seems reasonable. Please
let me know if there are problems, otherwise, I’m a happy camper now.
:slight_smile:

def reveal(name)
  unbound_method = find_hidden_method(name)
  fail "Don't know how to reveal method '#{name}'" unless 

unbound_method
define_method(name, unbound_method)
end

-greg


#2

2009/1/25 Gregory B. removed_email_address@domain.invalid:

On Sun, Jan 25, 2009 at 5:30 AM, Gregory B.
removed_email_address@domain.invalid wrote:

As it turns out, I was able to stop the method from binding to a
single instance without re-binding on every call. I simply changed
this code:

So that instead, it passed the UnboundMethod directly to
define_method. This does what I want and seems reasonable. Please
let me know if there are problems, otherwise, I’m a happy camper now.

Greg, thanks for sharing the result of your investigation!

Kind regards

robert