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/.