From: John Mair Date: 2011-02-23T09:05:14+09:00 Subject: Re: Q: How to call parent method explistly? It's ugly but this works (i assume Child subclasses Parent?) class Child < Parent def _hello(name) Parent.instance_method(:hello).bind(self).call(name) end end makoto kuwata wrote in post #983231: > Is it possible to call parent method specifying method name explicitly > like super.foobar() or parent::foobar()? > > class Parent > def hello(name) > puts "Hello #{name}!" > end > end > > class Child > def hello(name) > # ... > _hello(name) > # ... > end > private > def _hello(name) > # ... > super(name) # want to call Parent#hello(), not _hello() > # ... > end > end -- Posted via http://www.ruby-forum.com/.