Class: Array

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

Instance Method Summary collapse

Instance Method Details

#pairs(s = 2) ⇒ Object



14
15
16
17
18
# File 'lib/romkan.rb', line 14

def pairs(s=2)
  0.step(self.size-1,s){
    |x| yield self.slice(x,s)
  }
end