class Array

combines two arrays stolen from Juan Matias (jmrepetti) from stackoverflow.com

Public Instance Methods

combine(a) click to toggle source
# File lib/dust/helper.rb, line 5
def combine a
  return a if self.empty?
  return self if a.empty?

  aux = []
  self.each do |self_elem|
    a.each do |other_elem|
      aux << [ self_elem, other_elem ]
    end
  end
  aux.map {|elem| elem.flatten }
end