class Array def every(x) (size/x).times { |i| i *= x; yield(self[i..(i+x-1)]) } end end