Class: GorgonAMQ::Protocol::Connection::Blocked
- Defined in:
- lib/gorgon_amq-protocol/lib/gorgon_amq/protocol/client.rb
Instance Attribute Summary collapse
-
#reason ⇒ Object
readonly
Returns the value of attribute reason.
Class Method Summary collapse
- .decode(data) ⇒ Object
-
.encode(reason) ⇒ Object
[u’reason = EMPTY_STRING’].
- .has_content? ⇒ Boolean
Instance Method Summary collapse
-
#initialize(reason) ⇒ Blocked
constructor
A new instance of Blocked.
Methods inherited from Method
encode_body, index, inherited, instantiate, method_id, methods, name, split_headers
Constructor Details
#initialize(reason) ⇒ Blocked
Returns a new instance of Blocked.
530 531 532 |
# File 'lib/gorgon_amq-protocol/lib/gorgon_amq/protocol/client.rb', line 530 def initialize(reason) @reason = reason end |
Instance Attribute Details
#reason ⇒ Object (readonly)
Returns the value of attribute reason.
529 530 531 |
# File 'lib/gorgon_amq-protocol/lib/gorgon_amq/protocol/client.rb', line 529 def reason @reason end |
Class Method Details
.decode(data) ⇒ Object
520 521 522 523 524 525 526 527 |
# File 'lib/gorgon_amq-protocol/lib/gorgon_amq/protocol/client.rb', line 520 def self.decode(data) offset = 0 length = data[offset, 1].unpack(PACK_CHAR).first offset += 1 reason = data[offset, length] offset += length self.new(reason) end |
.encode(reason) ⇒ Object
- u’reason = EMPTY_STRING’
540 541 542 543 544 545 546 |
# File 'lib/gorgon_amq-protocol/lib/gorgon_amq/protocol/client.rb', line 540 def self.encode(reason) channel = 0 buffer = @packed_indexes.dup buffer << reason.to_s.bytesize.chr buffer << reason.to_s MethodFrame.new(buffer, channel) end |
.has_content? ⇒ Boolean
534 535 536 |
# File 'lib/gorgon_amq-protocol/lib/gorgon_amq/protocol/client.rb', line 534 def self.has_content? false end |