Class: Array
Instance Method Summary collapse
-
#to_proc ⇒ Proc
Convert Array into a Proc that takes an index and returns the value of the Array at that index.
Instance Method Details
#to_proc ⇒ Proc
Convert Array into a Proc that takes an index and returns the value of the Array at that index.
5 6 7 8 9 |
# File 'lib/data/functions/array.rb', line 5 def to_proc lambda do |i, *_| self.at(i) end end |