Method: Array#to_proc
- Defined in:
- lib/invokable/array.rb
#to_proc ⇒ Proc
Return a proc that takes the index of the array and returns the value at that index or nil if there is no value at the given index.
8 9 10 11 12 |
# File 'lib/invokable/array.rb', line 8 def to_proc lambda do |index| at(index) end end |