class Array

Public Instance Methods

to_proc() click to toggle source

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

@return [Proc]

# File lib/data/functions/array.rb, line 5
def to_proc
  lambda do |i, *_|
    self.at(i)
  end
end