Class: Array

Inherits:
Object
  • Object
show all
Defined in:
lib/core_ext/array.rb

Overview

Instance Method Summary collapse

Instance Method Details

#spread(n) ⇒ Object



3
4
5
6
# File 'lib/core_ext/array.rb', line 3

def spread(n)
  step = self.length.to_f / n
  array = (0..(n - 1)).to_a.collect{|i| self[(i * step)]}.uniq
end