introspection/function/name.rb
tests/_examples/introspection/function/name.rb in the metorex repository.
def greet(name)
"Hello, " + name
end
def calculate(x, y)
x + y
end
puts method(:greet).name
puts method(:calculate).name
Output:
greet
calculate