Ezra Zygmuntowicz
3/20/2008 11:59:00 PM
On Mar 20, 2008, at 4:50 PM, Daniel Finnie wrote:
> Hi all,
>
> Does anyone know how to invoke super so that it passes no arguments to
> the superclass' method?
>
> For example:
>
> class A
> def initialize
> puts "making an A"
> end
> end
>
> class B < A
> def initialize var
> puts "making a #{var} b"
> super
super()
When you call super as a bare word, it passes the args from the
enclosing method automatically, to force it to pass no args you need
to use super() .
Cheers-
- Ezra Zygmuntowicz
-- Founder & Software Architect
-- ezra@engineyard.com
-- EngineYard.com