Class: GeoPattern::Seed

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

Instance Method Summary collapse

Constructor Details

#initialize(string) ⇒ Seed


9
10
11
# File 'lib/geo_pattern/seed.rb', line 9

def initialize(string)
  @seed = Digest::SHA1.hexdigest string.to_s
end

Instance Method Details

#[](*args) ⇒ Object


13
14
15
# File 'lib/geo_pattern/seed.rb', line 13

def [](*args)
  seed[*args]
end

#to_i(index, length) ⇒ Object


17
18
19
# File 'lib/geo_pattern/seed.rb', line 17

def to_i(index, length)
  seed[index, length || 1].to_i(16)
end