Module: Hash::Cross

Included in:
Hash
Defined in:
lib/vex/base/hash/cross.rb

Defined Under Namespace

Modules: Etest

Instance Method Summary collapse

Instance Method Details

#cross(*keys) ⇒ Object

{ :a => [ 1, 2], :b => [ “bb”, “cc”], :c => :cc }.cross =>

[ { :a => 1, :b => “bb”, :c => :cc }, { :a => 2, :b => “bb”, :c => :cc }, { :a => 1, :b => “cc”, :c => :cc }, { :a => 2, :b => “cc”, :c => :cc } ]



12
13
14
# File 'lib/vex/base/hash/cross.rb', line 12

def cross(*keys)
  dup.send :do_cross, *keys
end