Module: Enumerable
- Defined in:
- lib/csquares/core_ext.rb
Instance Method Summary collapse
Instance Method Details
#interleave(enum2) ⇒ Object
5 6 7 8 9 |
# File 'lib/csquares/core_ext.rb', line 5 def interleave(enum2) e1, e2, res = to_a.reverse, enum2.to_a.reverse, [] res.push e1.pop, e2.pop until e1.empty? or e2.empty? res + (e1 + e2) .reverse end |