Class: HugeProduct
- Inherits:
-
HugeEnumerable
- Object
- HugeEnumerable
- HugeProduct
- Defined in:
- lib/huge_enumerable/huge_product.rb
Overview
name[size / 2] # => “Charlotte Zoe”
Constant Summary
Constants inherited from HugeEnumerable
HugeEnumerable::DEFAULT_MAX_ARRAY_SIZE, HugeEnumerable::VERSION
Instance Attribute Summary
Attributes inherited from HugeEnumerable
Instance Method Summary collapse
-
#initialize(enumerable_a, enumerable_b, max_array_size = nil, rng = nil) ⇒ HugeProduct
constructor
Create a new HugeProduct.
Methods inherited from HugeEnumerable
#[], #collection_each, #combination, #each, #empty?, #initialize_copy, #next_array, #permutation, #pop, #product, #sample, #shift, #shuffle, #shuffle!, #size
Constructor Details
#initialize(enumerable_a, enumerable_b, max_array_size = nil, rng = nil) ⇒ HugeProduct
Create a new HugeProduct
Attributes
-
enumerable_a
- Any enumerable that responds to [] -
enumerable_b
- Any enumerable that responds to [] (This can be the same object as enumerable_a)
Options
-
:max_array_size
- The default size of arrays when #to_a is called. -
:rng
- The random number generator to use.
51 52 53 54 55 |
# File 'lib/huge_enumerable/huge_product.rb', line 51 def initialize(enumerable_a, enumerable_b, max_array_size = nil, rng = nil) @enum_a = enumerable_a @enum_b = enumerable_b super(max_array_size, rng) end |