Hi,
I can't seem to get it right with a super (newbie stuff :)).
I expect the following program :
-------------------------------
class Boo
def say_what
puts "boo what ?"
end
end
#
a = Boo.new
a.say_what
#
class Foo < Boo
def say_what
super.say_what
puts "FOO this!"
end
end
#
b = Foo.new
b.say_what
-------------------------------
to output
boo what?
boo what?
FOO this!
Instead I get :
-------------------------------
boo what ?
-------------------------------
on ruby 1.7.2 (2002-03-29) [i686-cygwin]
and
-------------------------------
boo what ?
boo what ?
class_object_vars.rb:12:in `say_what': undefined method `say_what' for nil
(NoMethodError)
from class_object_vars.rb:18
-------------------------------
on ruby 1.7.2 (2002-03-20) [i386-mswin32]
class_object_vars.rb:12: being the super.say_what line...
Could someone please clear me out why is this happening ?
Thanks,
philip