Class: ZooPass::Generator

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

Instance Method Summary collapse

Constructor Details

#initialize(animals = ANIMALS) ⇒ Generator

Returns a new instance of Generator.



10
11
12
# File 'lib/zoo_pass.rb', line 10

def initialize(animals = ANIMALS)
  @animals = animals
end

Instance Method Details

#generate(length = DEFAULT_LENGTH) ⇒ Object



14
15
16
# File 'lib/zoo_pass.rb', line 14

def generate(length = DEFAULT_LENGTH)
  @animals.shuffle.take(length).join('-')
end