Exception: AMQ::Protocol::Error

Inherits:
StandardError
  • Object
show all
Defined in:
lib/amq/protocol/client.rb

Constant Summary collapse

DEFAULT_MESSAGE =
"AMQP error".freeze

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message = self.class::DEFAULT_MESSAGE) ⇒ Error

self.[]



62
63
64
# File 'lib/amq/protocol/client.rb', line 62

def initialize(message = self.class::DEFAULT_MESSAGE)
  super(message)
end

Class Method Details

.[](code) ⇒ Object

self.subclasses_with_values



54
55
56
57
58
59
60
# File 'lib/amq/protocol/client.rb', line 54

def self.[](code)
  if result = subclasses_with_values.detect { |klass| klass::VALUE == code }
    result
  else
    raise "No such exception class for code #{code}" unless result
  end # if
end

.inherited(subclass) ⇒ Object



45
46
47
48
# File 'lib/amq/protocol/client.rb', line 45

def self.inherited(subclass)
  @_subclasses ||= []
  @_subclasses << subclass
end

.subclasses_with_valuesObject

self.inherited(subclazz)



50
51
52
# File 'lib/amq/protocol/client.rb', line 50

def self.subclasses_with_values
  @_subclasses.select{ |k| defined?(k::VALUE) }
end