En ce moment, mon code fonctionne en tant que tel:Comment retourner le nom de chaîne de la méthode d'appel?
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
au lieu d'imprimer de method_b « de method_b », comment puis-je imprimer le nom de la méthode d'appel - « method_a »?