Right now my code works as such:
def method_a
self.method_b ==> 'method_b'
end
def method_b
puts self.name_of_calling_method
end
def name_of_calling_method
if /`(.*)'/.match(caller.first)
return $1
else
return nil
end
end
Instead of method_b printing 'method_b', how can I print the name of the calling method - 'method_a'?