ruby - How to get the name of the calling method? -


is there way in ruby find calling method name inside of method?

for example:

class test   def self.foo     fooz.bar   end end  class fooz   def self.bar     # test.foo or foo   end end 

puts caller[0] 

or perhaps...

puts caller[0][/`.*'/][1..-2] 

Comments

Popular posts from this blog

c# - Is it possible to remove an existing registration from Autofac container builder? -

asp.net - RadAsyncUpload in code behind, how to? -