Last Updated: February 25, 2016
·
258
· mecampbellsoup

How to use a normal Ruby method like a block

foo_plus = "foo".method(:+)
foo_plus.class       # Method < Object
foo_plus.arity       # 1
foo_plus.call(" bar") # "foo bar"

Credits: http://makandracards.com/makandra/1659-use-a-ruby-method-like-a-block-or-lambda