Class: AMQ::Protocol::Connection::UpdateSecret
- Defined in:
- lib/amq/protocol/client.rb
Instance Attribute Summary collapse
-
#new_secret ⇒ Object
readonly
Returns the value of attribute new_secret.
-
#reason ⇒ Object
readonly
Returns the value of attribute reason.
Class Method Summary collapse
- .decode(data) ⇒ Object
-
.encode(new_secret, reason) ⇒ Object
[u’new_secret = nil’, u’reason = nil’].
- .has_content? ⇒ Boolean
Instance Method Summary collapse
-
#initialize(new_secret, reason) ⇒ UpdateSecret
constructor
A new instance of UpdateSecret.
Methods inherited from Method
encode_body, index, inherited, instantiate, method_id, methods, name, split_headers
Constructor Details
#initialize(new_secret, reason) ⇒ UpdateSecret
Returns a new instance of UpdateSecret.
600 601 602 603 |
# File 'lib/amq/protocol/client.rb', line 600 def initialize(new_secret, reason) @new_secret = new_secret @reason = reason end |
Instance Attribute Details
#new_secret ⇒ Object (readonly)
Returns the value of attribute new_secret.
599 600 601 |
# File 'lib/amq/protocol/client.rb', line 599 def new_secret @new_secret end |
#reason ⇒ Object (readonly)
Returns the value of attribute reason.
599 600 601 |
# File 'lib/amq/protocol/client.rb', line 599 def reason @reason end |
Class Method Details
.decode(data) ⇒ Object
586 587 588 589 590 591 592 593 594 595 596 597 |
# File 'lib/amq/protocol/client.rb', line 586 def self.decode(data) offset = offset = 0 # self-assigning offset to eliminate "assigned but unused variable" warning even if offset is not used in this method length = data[offset, 4].unpack(PACK_UINT32).first offset += 4 new_secret = data[offset, length] offset += length length = data[offset, 1].unpack(PACK_CHAR).first offset += 1 reason = data[offset, length] offset += length self.new(new_secret, reason) end |
.encode(new_secret, reason) ⇒ Object
- u’new_secret = nil’, u’reason = nil’
611 612 613 614 615 616 617 618 619 |
# File 'lib/amq/protocol/client.rb', line 611 def self.encode(new_secret, reason) channel = 0 buffer = @packed_indexes.dup buffer << [new_secret.to_s.bytesize].pack(PACK_UINT32) buffer << new_secret.to_s buffer << reason.to_s.bytesize.chr buffer << reason.to_s MethodFrame.new(buffer, channel) end |
.has_content? ⇒ Boolean
605 606 607 |
# File 'lib/amq/protocol/client.rb', line 605 def self.has_content? false end |