Thanks!

I really dislike these language features turned methods, I just
assumed that super() would be the same as super

Dan

On Thu, Mar 20, 2008 at 8:05 PM, 7stud -- <bbxx789_05ss / yahoo.com> wrote:
>
> 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
>  >   end
>  > end
>  >
>  > B.new "great"
>  >
>  > results in:
>  > making a great b
>  > /tmp/super.rb:10:in `initialize': wrong number of arguments (1 for 0)
>  > (ArgumentError)
>  >         from /tmp/super.rb:10:in `initialize'
>  >         from /tmp/super.rb:14:in `new'
>  >         from /tmp/super.rb:14
>  >
>
>  class A
>   def initialize
>     puts "making an A"
>   end
>  end
>
>  class B < A
>   def initialize var
>     puts "making a #{var} b"
>     super()
>   end
>  end
>
>  B.new "great"
>
>  --output:--
>  making a great b
>  making an A
>  --
>  Posted via http://www.ruby-forum.com/.
>
>