Module: AMQP::Entity Abstract

Includes:
Callbacks, Openable
Included in:
Channel, Exchange, Queue
Defined in:
lib/amqp/entity.rb

Overview

This module is abstract.
Note:

Exchanges and queues implementation is based on this class.

AMQ entities, as implemented by AMQP, have callbacks and can run them when necessary.

Constant Summary

Constants included from Openable

Openable::VALUES

Instance Attribute Summary collapse

Attributes included from Openable

#status

Instance Method Summary collapse

Methods included from Callbacks

#clear_callbacks, #define_callback, #exec_callback, #exec_callback_once, #exec_callback_once_yielding_self, #exec_callback_yielding_self, #has_callback?, #prepend_callback, #redefine_callback

Methods included from Openable

#closed!, #closed?, #closing!, #closing?, #opened!, #opened?, #opening!, #opening?

Instance Attribute Details

#callbacksArray<#call> (readonly)

Returns:

  • (Array<#call>)


50
51
52
# File 'lib/amqp/entity.rb', line 50

def callbacks
  @callbacks
end

Instance Method Details

#initialize(connection) ⇒ Object



53
54
55
56
57
58
# File 'lib/amqp/entity.rb', line 53

def initialize(connection)
  @connection = connection
  # Be careful with default values for #ruby hashes: h = Hash.new(Array.new); h[:key] ||= 1
  # won't assign anything to :key. MK.
  @callbacks  = Hash.new
end