Rubyで少し遊んでいる間、私は次のコードを書きました。
class A
end
A.singleton_class.instance_eval do
undef_method :new
end
# or
# class << B
# undef_method :new
# end
A.new
> NoMethodError: undefined method `new' for A:Class
> from (irb):8
> from /home/mmsequeira/.rvm/rubies/ruby-1.9.3-p327/bin/irb:16:in `<main>'
これはカッコいい。しかし、特定のクラスでどのメソッドが未定義であるかをどのように知ることができますか?