Class: Symbol
Instance Method Summary collapse
-
#to_proc ⇒ Object
Return a proc which sends itself as a message to the first proc argument.
Instance Method Details
#to_proc ⇒ Object
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 |