現在、私のコードは次のように機能します。
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
method_b が「method_b」を出力する代わりに、呼び出し元のメソッドの名前「method_a」を出力するにはどうすればよいですか?