5 July 2007 Manfred Stienstra and Norbert Crombach

In Ruby the & character maps to the to_proc method. In this episode Manfred shows what you can do with it and how it works.

Download episode

# Symbol#to_proc is defined in Rails and will be part of Ruby 1.9

class Symbol
  def to_proc
    lambda { |*args| args.shift.__send__(self, *args) }
  end
end