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

python - How to create a legend for 3D bar in matplotlib? -

java - Multi-Label Document Classification -

php - Dynamic url re-writing using htaccess -