From: Josef Wolf Date: 2009-09-09T19:57:33+09:00 Subject: How to get the return value from method of the super class? Hello, I am trying to override a method of a superclass within my derived class. To do the real work, I need to call the original method of the superclass. But when I try to get the return value of the super method, I only get the object, not the return values I expected. Here's a code snippet to demonstrate the problem, stripped from everything not related to the problem: jw@raven> cat ./test.rb #! /usr/bin/ruby require 'tk' require 'pp' root = TkRoot.new { title "pcb.rb" } class TkDerivedCanvas < TkCanvas def coords(tag, *args) super(tag, args) end end orig = TkCanvas.new(:scrollregion=>[0,0,500,400]).pack() derived = TkDerivedCanvas.new(:scrollregion=>[0,0,500,400]).pack() origrect = TkcRectangle.new(orig, [100,100], [300, 200], :fill=>"red") derivedrect = TkcRectangle.new(derived, [100,100], [300, 200], :fill=>"red") pp orig.coords(origrect) pp derived.coords(derivedrect) jw@raven> ./test.rb [100.0, 100.0, 300.0, 200.0] # jw@raven> Any ideas what I am doing wrong here?