Class: MockZombieFactory

Inherits:
Object
  • Object
show all
Defined in:
lib/zombie-chaser/human.rb

Instance Method Summary collapse

Constructor Details

#initialize(zombies_results, world) ⇒ MockZombieFactory

Returns a new instance of MockZombieFactory.



229
230
231
232
# File 'lib/zombie-chaser/human.rb', line 229

def initialize(zombies_results, world)
  @zombies_results, @world = zombies_results, world
  @current_zombie_number = 0
end

Instance Method Details

#create_zombieObject



234
235
236
237
238
# File 'lib/zombie-chaser/human.rb', line 234

def create_zombie
  mock_zombie = MockZombie.new_using_results(@zombies_results[@current_zombie_number], @world)
  @current_zombie_number += 1
  mock_zombie
end