Class Symbol
In: lib/extensions/symbol.rb
Parent: Object

Methods

to_proc  

Public Instance methods

Allows a Symbol to be implicitly converted to a Proc.

This allows such conveniences as:

  %{john terry fiona}.map(&:capitalize)   # -> %{John Terry Fiona}
  sum = numbers.inject(&:+)

[Source]

# File lib/extensions/symbol.rb, line 23
    def to_proc
      proc { |obj, *args| obj.send(self, *args) }
    end

[Validate]