Class: GeoPattern::PatternSieve

Inherits:
Object
  • Object
show all
Defined in:
lib/geo_pattern/pattern_sieve.rb

Instance Method Summary collapse

Constructor Details

#initialize(requested_patterns, seed, pattern_store = PatternStore.new) ⇒ PatternSieve

Returns a new instance of PatternSieve


9
10
11
12
13
14
15
16
# File 'lib/geo_pattern/pattern_sieve.rb', line 9

def initialize(requested_patterns, seed, pattern_store = PatternStore.new)
  @requested_patterns = requested_patterns
  @seed               = seed
  @pattern_store      = pattern_store

  @available_patterns = determine_available_patterns
  @index              = determine_index
end

Instance Method Details

#fetchObject


18
19
20
# File 'lib/geo_pattern/pattern_sieve.rb', line 18

def fetch
  available_patterns[index]
end