Subject: get caller of method
From: thomas coopman <thomas.coopman gmail.com>
Date: Mon, 24 Jul 2006 04:06:56 +0900
Hi,
Does there exist a method to get the object or type of object that calls this method?
for example:
class Foo
do
end
class Bar
do
end
do
if caller.kind_of?(Foo)
puts "Foo"
elsif caller.kind_of?(Bar)
puts "Bar"
end
end
Thanks!