undef singleton method from ruby object -


i able undef singleton method on given object.

class end  = a.new def a.foo   puts "bar" end  # undef a.foo here a.foo # should crash 

class end  = a.new def a.foo   puts "bar" end  a.instance_eval { undef :foo }  a.foo # =>  undefined method `foo' #<a:0x8469c60> (nomethoderror) 

Comments

Popular posts from this blog

blackberry 10 - how to add multiple markers on the google map just by url? -

php - guestbook returning database data to flash -

java - Using an Integer ArrayList in Android -