From: Mario Ruiz Date: 2008-08-01T20:44:29+09:00 Subject: Re: Get the caller of a class Sorry the code was wrong, it should be: class MyClass def MyClass.doit caller= How can I do it puts 'I was called from: ' + caller.class.to_s() puts 'the value of the @variab is: ' + caller.variab.to_s() end end class MyCaller attr_reader :variab attr_writer :variab def initialize puts 'starts' end def callit @variab="example" result=MyClass.doit end end MyCaller.new().callit -- Posted via http://www.ruby-forum.com/.