is there a way in Ruby to find the calling method name inside of a method?
For example:
class Test def self.foo Fooz.bar end end class Fooz def self.bar # get Test.foo or foo end end
puts caller[0]
or perhaps...
puts caller[0][/`.*'/][1..-2]
2.1m questions
2.1m answers
60 comments
57.0k users