Class: HugeCollection

Inherits:
HugeEnumerable show all
Defined in:
lib/huge_enumerable/huge_collection.rb

Overview

collection # => “etneuebyurxgrvrfsreesxuvjaiyoqwplofsptacjdbhuhafdiwbwujvniokltgkjbfkiuy”

Direct Known Subclasses

HugeCombination, HugePermutation

Constant Summary

Constants inherited from HugeEnumerable

HugeEnumerable::DEFAULT_MAX_ARRAY_SIZE, HugeEnumerable::VERSION

Instance Attribute Summary

Attributes inherited from HugeEnumerable

#max_array_size, #rng

Instance Method Summary collapse

Methods inherited from HugeEnumerable

#[], #collection_each, #combination, #each, #empty?, #next_array, #permutation, #pop, #product, #sample, #shift, #shuffle, #shuffle!, #size

Constructor Details

#initialize(enumerable, max_array_size = nil, rng = nil) ⇒ HugeCollection

Create a new HugeCollection

Attributes

  • enumerable - Any enumerable that responds to []

Options

  • :max_array_size - The default size of arrays when #to_a is called.

  • :rng - The random number generator to use.



62
63
64
65
# File 'lib/huge_enumerable/huge_collection.rb', line 62

def initialize(enumerable, max_array_size = nil, rng = nil)
  @enum = enumerable
  super(max_array_size, rng)
end