Class: Array

Inherits:
Object show all
Defined in:
lib/data/functions/array.rb

Instance Method Summary collapse

Instance Method Details

#to_procProc

Convert Array into a Proc that takes an index and returns the value of the Array at that index.

Returns:

  • (Proc)


5
6
7
8
9
# File 'lib/data/functions/array.rb', line 5

def to_proc
  lambda do |i, *_|
    self.at(i)
  end
end