I would like to be able to undef a singleton method on a given object.
class A
end
a = A.new
def a.foo
puts "bar"
end
# undef a.foo here
a.foo # should crash
class << a
undef foo
end
Alternatively:
a.singleton_class.send :undef_method, :foo
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With