On Thu, Feb 28, 2013 at 1:34 PM, Tukai Patra <[email protected]> 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:0x117bca0> >>> 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?
You _did_ call #old_show. Cheers robert -- remember.guy do |as, often| as.you_can - without end http://blog.rubybestpractices.com/ -- [email protected] | https://groups.google.com/d/forum/ruby-talk-google?hl=en --- You received this message because you are subscribed to the Google Groups "ruby-talk-google" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/groups/opt_out.
