Class: HugePermutation
- Inherits:
-
HugeCollection
- Object
- HugeEnumerable
- HugeCollection
- HugePermutation
- Defined in:
- lib/huge_enumerable/huge_permutation.rb
Overview
southern_name[size / 2] # => “Your southern name is: Jimmy Ann”
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, size, max_array_size = nil, rng = nil) ⇒ HugePermutation
constructor
Create a new HugePermutation.
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, size, max_array_size = nil, rng = nil) ⇒ HugePermutation
Create a new HugePermutation
Attributes
-
enumerable
- Any enumerable that responds to [] -
size
- The number of elements per permutation to use from enumerable.
Options
-
:max_array_size
- The default size of arrays when #to_a is called. -
:rng
- The random number generator to use.
50 51 52 53 |
# File 'lib/huge_enumerable/huge_permutation.rb', line 50 def initialize(enumerable, size, max_array_size = nil, rng = nil) @permutation_size = size super(enumerable, max_array_size, rng) end |