Class: BunnyCleaner::Session

Inherits:
Object
  • Object
show all
Defined in:
lib/gorg_service/rspec/bunny_cleaner.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(*args, &block) ⇒ Session

Returns a new instance of Session.



4
5
6
# File 'lib/gorg_service/rspec/bunny_cleaner.rb', line 4

def initialize(*args, &block)
  @target=Bunny::Session.new(*args,&block)
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method, *args, &block) ⇒ Object



8
9
10
# File 'lib/gorg_service/rspec/bunny_cleaner.rb', line 8

def method_missing(method, *args, &block)
  @target.send(method, *args, &block)
end

Class Method Details

.method_missing(method, *args, &block) ⇒ Object



12
13
14
# File 'lib/gorg_service/rspec/bunny_cleaner.rb', line 12

def self.method_missing(method, *args, &block)
  Bunny::Session.send(method, *args, &block)
end

Instance Method Details

#create_channel(*args, &block) ⇒ Object



16
17
18
19
20
# File 'lib/gorg_service/rspec/bunny_cleaner.rb', line 16

def create_channel(*args,&block)
  ch=@target.create_channel(*args,&block)
  BunnyCleaner.registered_channels<<ch
  ch
end