Q:

How to change instance method's visibility

I want to change an instance method's visibility from public to private.
ooo = Object.new
def ooo.some_public; 'woot' end
ooo.some_public # => "woot"
ooo.respond_to?(:some_public) # => true

I want ooo.some_public to be private. How can I do that?

A:

ooo = Object.new
def ooo.some_public; 'woot' end
ooo.respond_to?(:some_public) # => true
ooo.singleton_class.class_eval{private :some_public}
ooo.respond_to?(:some_public) # => false

