Class: Freddy::Adapters::BunnyAdapter

Inherits:
Object
  • Object
show all
Defined in:
lib/freddy/adapters/bunny_adapter.rb

Defined Under Namespace

Classes: Channel, Queue

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(bunny) ⇒ BunnyAdapter

Returns a new instance of BunnyAdapter.



12
13
14
# File 'lib/freddy/adapters/bunny_adapter.rb', line 12

def initialize(bunny)
  @bunny = bunny
end

Class Method Details

.connect(config) ⇒ Object



6
7
8
9
10
# File 'lib/freddy/adapters/bunny_adapter.rb', line 6

def self.connect(config)
  bunny = Bunny.new(config)
  bunny.start
  new(bunny)
end

Instance Method Details

#closeObject



20
21
22
# File 'lib/freddy/adapters/bunny_adapter.rb', line 20

def close
  @bunny.close
end

#create_channelObject



16
17
18
# File 'lib/freddy/adapters/bunny_adapter.rb', line 16

def create_channel
  Channel.new(@bunny.create_channel)
end