Method: Array#to_proc
- Defined in:
- lib/functions/prelude_lambda/ext.rb
#to_proc ⇒ Object
converts the array into a Proc where the first element is the method name, other elements are the values
6 7 8 9 |
# File 'lib/functions/prelude_lambda/ext.rb', line 6 def to_proc head, *tail = *self Proc.new { |obj, *other| obj.__send__(head, *(other + tail)) } end |