Sha256: b982364e8cd177a22914e8281f66532a564e5efbdcf63c3b8d15a64be67f5d3d

Contents?: true

Size: 206 Bytes

Versions: 2

Compression:

Stored size: 206 Bytes

Contents

class Array
  # Convert Array into a Proc that takes an index and returns the value of the Array at that index.
  #
  # @return [Proc]
  def to_proc
    lambda do |i, *_|
      self.at(i)
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
data-functions-0.1.1 lib/data/functions/array.rb
data-functions-0.1.0 lib/data/functions/array.rb