From: Robert Klemme Date: 2008-08-01T22:20:10+09:00 Subject: Re: Get the caller of a class 2008/8/1 Mario Ruiz : There is no such thing as the "caller of a class": a class can be used by many clients and only methods are actually "called". "caller" is actually already defined. See whether this helps: 15:19:02 bas$ irb Ruby version 1.8.7 irb(main):001:0> def a(n) b(n) end => nil irb(main):002:0> def b(n) caller(n) end => nil irb(main):003:0> 3.times {|i| puts i, a(i), "----"} 0 (irb):2:in `b' (irb):1:in `a' (irb):4:in `irb_binding' (irb):4:in `times' (irb):4:in `irb_binding' /usr/lib/ruby/1.8/irb/workspace.rb:52:in `irb_binding' /usr/lib/ruby/1.8/irb/workspace.rb:52 ---- 1 (irb):1:in `a' (irb):4:in `irb_binding' (irb):4:in `times' (irb):4:in `irb_binding' /usr/lib/ruby/1.8/irb/workspace.rb:52:in `irb_binding' /usr/lib/ruby/1.8/irb/workspace.rb:52 ---- 2 (irb):4:in `irb_binding' (irb):4:in `times' (irb):4:in `irb_binding' /usr/lib/ruby/1.8/irb/workspace.rb:52:in `irb_binding' /usr/lib/ruby/1.8/irb/workspace.rb:52 ---- => 3 Kind regards robert -- use.inject do |as, often| as.you_can - without end