Class: GeoPattern::Seed

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

Instance Method Summary collapse

Constructor Details

#initialize(string) ⇒ Seed

Returns a new instance of Seed.



11
12
13
# File 'lib/geo_pattern/seed.rb', line 11

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

Instance Method Details

#[](*args) ⇒ Object



15
16
17
# File 'lib/geo_pattern/seed.rb', line 15

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

#to_i(index, length) ⇒ Object



19
20
21
# File 'lib/geo_pattern/seed.rb', line 19

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