Method: Pbt::Arbitrary::FixedHashArbitrary#initialize

Defined in:
lib/pbt/arbitrary/fixed_hash_arbitrary.rb

#initialize(hash) ⇒ FixedHashArbitrary

Returns a new instance of FixedHashArbitrary.

Parameters:

  • hash (Hash<Object, Arbitrary<T>>)

    Hash with any keys and arbitraries as values.

[View source]

8
9
10
11
# File 'lib/pbt/arbitrary/fixed_hash_arbitrary.rb', line 8

def initialize(hash)
  @keys = hash.keys
  @arb = TupleArbitrary.new(*hash.values)
end