Class: Bunnicula::BunnyFarm

Inherits:
Object show all
Defined in:
lib/bunnicula/bunny_farm.rb

Class Method Summary collapse

Class Method Details

.breed(connection_options = {}) ⇒ Object



8
9
10
11
12
13
# File 'lib/bunnicula/bunny_farm.rb', line 8

def self.breed(connection_options={})
  bunny = Bunny.new(connection_options)
  bunnies << bunny
  bunny.start
  bunny
end

.bunniesObject



4
5
6
# File 'lib/bunnicula/bunny_farm.rb', line 4

def self.bunnies
  @@bunnies ||= []
end

.stopObject



17
18
19
# File 'lib/bunnicula/bunny_farm.rb', line 17

def self.stop
  bunnies.each {|bunny|bunny.stop}
end