Class: RabbitmqClient::Plugin

Inherits:
Object
  • Object
show all
Defined in:
lib/rabbitmq_client/plugin.rb

Overview

Plugin class is the base class for all Plugins that extends RabbitmqClient functionalty.

Class Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializePlugin

Returns a new instance of Plugin.



15
16
17
# File 'lib/rabbitmq_client/plugin.rb', line 15

def initialize
  callback_block.call(RabbitmqClient.lifecycle)
end

Class Attribute Details

.callback_blockObject

Returns the value of attribute callback_block.



25
26
27
# File 'lib/rabbitmq_client/plugin.rb', line 25

def callback_block
  @callback_block
end

Class Method Details

.callbacks(&block) ⇒ Object



26
27
28
# File 'lib/rabbitmq_client/plugin.rb', line 26

def callbacks(&block)
  @callback_block = block
end

Instance Method Details

#callback_blockObject



19
20
21
22
# File 'lib/rabbitmq_client/plugin.rb', line 19

def callback_block
  klass = self.class
  klass.callback_block || (raise EmptyPlugin, klass.to_s)
end