Class: MockZombieFactory
- Inherits:
-
Object
- Object
- MockZombieFactory
- Defined in:
- lib/zombie-chaser/human.rb
Instance Method Summary collapse
- #create_zombie ⇒ Object
-
#initialize(zombies_results, world) ⇒ MockZombieFactory
constructor
A new instance of MockZombieFactory.
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_zombie ⇒ Object
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 |