On 4/2/07, Dan Stevens (IAmAI) <dan.stevens.iamai / gmail.com> wrote:
> Could someone explain why the following code raises ArgumentError. Thanks.
>
> class SuperClass
>
>         def initialize #Make sure you spell 'initialize' correctly!
>                 @my_attr = 1
>         end
>
>         attr_reader :my_attr
> end
>
> class SubClass < SuperClass
>
>         def initialize(data1, data2)
>                 super

This should be super(). Without the parenthesis it defaults to passing
the arguments given to the current method to the super class's
implementation.

Ryan