Class: Symbol

Inherits:
Object show all
Defined in:
lib/rext/symbol/helpers.rb

Instance Method Summary collapse

Instance Method Details

#to_procObject

Return a proc which sends itself as a message to the first proc argument.

Examples

%w( some foo bar ).map(&:length)  # => [4, 3, 3]


13
14
15
# File 'lib/rext/symbol/helpers.rb', line 13

def to_proc
  Proc.new { |object| object.send self }
end