class Array # Fetch values from a start index thru an end index. # # require 'facet/array/upto' # # [1,2,3,4,5].thru(0,2) #=> [1,2,3] # [1,2,3,4,5].thru(2,4) #=> [3,4,5] # def thru( from, to ) a = [] i = from while i <= to a << self.at(i) i += 1 end a end end