From: Alex Gutteridge Date: 2013-02-28T21:46:48+09:00 Subject: Re: Discussion on Ruby's `alias` On 28.02.2013 12:34, Tukai Patra wrote: >>> class Foo >>> def show >>> p "hi" >>> end >>> end > => nil >>> class Foo >>> alias :old_show :show >>> def show >>> p "hi! I am there." >>> old_show >>> end >>> end > => nil >>> foo = Foo.new > => # >>> foo.show > "hi! I am there." > "hi" > => "hi" >>> > > The above code is very fine. But looking for if possible to call that > `old_show` method by the object of `Foo` from `IRB main` as we called > `foo.show`? - Is this possible? Uh, yes you just call it, unless I totally misunderstand your question? class Foo def bar puts "bar" end end ==>nil class Foo alias :baz :bar def bar puts "baz" baz end end ==>nil foo = Foo.new ==># foo.bar baz bar ==>nil foo.baz bar ==>nil -- Alex Gutteridge