&
trick (typically used to convert an object to a proc; e.g. https://gist.github.com/Integralist/11206577) to convert a method (retrieved using method()
) to a proc so it can be utilised by another methoddef hello(&block)
block.call if block_given?
end
def world
"world"
end
hello # => nil
hello { "world" } # => "world"
hello(&method(:world)) # => "world"