Hi, if class A contains method "hello" and class B inherits from A, is
it possible to remove method "hello" in the definition of class B?
Maybe a workaround could be making "hello" method private in class B.
NOTE: I do know that I can override "hello" method (something as "def
hello; nil; end") but I don't want it.
Thanks for any suggestion.
···
--
Iñaki Baz Castillo
<ibc@aliax.net>
Are you looking to do this to make it use A#hello instead of B#hello ? If
so, you might consider using `super`. That aside, you can look at
Kernel#undef_method and Kernel#remove_method (the two have different
semantics).
http://ruby-doc.org/core/classes/Module.html#M000446
···
On Fri, Mar 4, 2011 at 6:14 PM, Iñaki Baz Castillo <ibc@aliax.net> wrote:
Hi, if class A contains method "hello" and class B inherits from A, is
it possible to remove method "hello" in the definition of class B?
Maybe a workaround could be making "hello" method private in class B.
NOTE: I do know that I can override "hello" method (something as "def
hello; nil; end") but I don't want it.
Kernel#undef_method is exactly what I was looking for 
Thanks a lot.
···
2011/3/4 Adam Prescott <mentionuse@gmail.com>:
Are you looking to do this to make it use A#hello instead of B#hello ? If
so, you might consider using `super`. That aside, you can look at
Kernel#undef_method and Kernel#remove_method (the two have different
semantics).
class Module - RDoc Documentation
--
Iñaki Baz Castillo
<ibc@aliax.net>