Class: RabbitmqClient::Plugin
- Inherits:
-
Object
- Object
- RabbitmqClient::Plugin
- 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
-
.callback_block ⇒ Object
Returns the value of attribute callback_block.
Class Method Summary collapse
Instance Method Summary collapse
- #callback_block ⇒ Object
-
#initialize ⇒ Plugin
constructor
A new instance of Plugin.
Constructor Details
#initialize ⇒ Plugin
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_block ⇒ Object
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_block ⇒ Object
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 |