From: Brian Jolly Date: 2011-08-26T04:56:03+09:00 Subject: Re: calling a descendant's method --0016e64ca97271e69504ab59d1a1 Content-Type: text/plain; charset=ISO-8859-1 This returns "HoHo" for me. On Thu, Aug 25, 2011 at 12:48 PM, Alexey Muranov < muranov@math.univ-toulouse.fr> wrote: > Hello, > > is it possible in Ruby to make a method of a class calling another > method to always call the version of that method from the descendant? > I do not know how to put this more clear, so here is an example: > > class A > def f > g # what to put here? > end > > def g > "Haha" > end > end > > class B < A > def g > "Hoho" > end > end > > B.new.f # i want this to return "Hoho", but it will return "Haha" > > Thanks. > > Alexey > > -- > Posted via http://www.ruby-forum.com/. > > --0016e64ca97271e69504ab59d1a1--