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

linux - Mailx and Gmail nss config dir -

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

php - Mysql PK and FK char(36) vs int(10) -