Exception: GorgonAMQ::Protocol::Error
- Inherits:
-
StandardError
- Object
- StandardError
- GorgonAMQ::Protocol::Error
- Defined in:
- lib/gorgon_amq-protocol/lib/gorgon_amq/protocol/exceptions.rb
Direct Known Subclasses
BadResponseError, EmptyResponseError, FrameTypeError, HardError, SoftError
Constant Summary collapse
- DEFAULT_MESSAGE =
"AMQP error".freeze
Class Method Summary collapse
-
.[](code) ⇒ Object
self.subclasses_with_values.
- .inherited(subclass) ⇒ Object
-
.subclasses_with_values ⇒ Object
self.inherited(subclazz).
Instance Method Summary collapse
-
#initialize(message = self.class::DEFAULT_MESSAGE) ⇒ Error
constructor
self.[].
Constructor Details
#initialize(message = self.class::DEFAULT_MESSAGE) ⇒ Error
self.[]
23 24 25 |
# File 'lib/gorgon_amq-protocol/lib/gorgon_amq/protocol/exceptions.rb', line 23 def initialize( = self.class::DEFAULT_MESSAGE) super() end |
Class Method Details
.[](code) ⇒ Object
self.subclasses_with_values
15 16 17 18 19 20 21 |
# File 'lib/gorgon_amq-protocol/lib/gorgon_amq/protocol/exceptions.rb', line 15 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
6 7 8 9 |
# File 'lib/gorgon_amq-protocol/lib/gorgon_amq/protocol/exceptions.rb', line 6 def self.inherited(subclass) @_subclasses ||= [] @_subclasses << subclass end |
.subclasses_with_values ⇒ Object
self.inherited(subclazz)
11 12 13 |
# File 'lib/gorgon_amq-protocol/lib/gorgon_amq/protocol/exceptions.rb', line 11 def self.subclasses_with_values @_subclasses.select{ |k| defined?(k::VALUE) } end |