[Ruby] Вызов переопределенного метода базового класса из дочернего

Alexander Bokovoy a.bokovoy at sam-solutions.net
Fri Oct 11 18:11:19 MSD 2002


On Fri, Oct 11, 2002 at 04:28:36PM +0300, Olonichev Sergei wrote:
> Привет Все!
> 
> У меня вот такой вопрос:
> 
> class A
> public
>     def qqq()
>         puts "B"
>     end
> end
> 
> class B < A
> public
	alias :old_qqq, :qqq
>     def qqq()
>         puts "B"
>     end
> 
>     def www()
>         # Как отсюда вызвать A::qqq ?
	old_qqq
>     end
> end

-- 
/ Alexander Bokovoy
---
"Life sucks, but death doesn't put out at all...."
-- Thomas J. Kopp



More information about the Ruby mailing list