Class: AMQ::Protocol::Channel::FlowOk
- Defined in:
- lib/amq/protocol/client.rb
Instance Attribute Summary collapse
-
#active ⇒ Object
readonly
Returns the value of attribute active.
Class Method Summary collapse
- .decode(data) ⇒ Object
-
.encode(channel, active) ⇒ Object
[u’active = nil’].
- .has_content? ⇒ Boolean
Instance Method Summary collapse
-
#initialize(active) ⇒ FlowOk
constructor
A new instance of FlowOk.
Methods inherited from Method
encode_body, index, inherited, instantiate, method_id, methods, name, split_headers
Constructor Details
#initialize(active) ⇒ FlowOk
Returns a new instance of FlowOk.
762 763 764 |
# File 'lib/amq/protocol/client.rb', line 762 def initialize(active) @active = active end |
Instance Attribute Details
#active ⇒ Object (readonly)
Returns the value of attribute active.
761 762 763 |
# File 'lib/amq/protocol/client.rb', line 761 def active @active end |
Class Method Details
.decode(data) ⇒ Object
753 754 755 756 757 758 759 |
# File 'lib/amq/protocol/client.rb', line 753 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 bit_buffer = data[offset, 1].unpack(PACK_CHAR).first offset += 1 active = (bit_buffer & (1 << 0)) != 0 self.new(active) end |
.encode(channel, active) ⇒ Object
- u’active = nil’
772 773 774 775 776 777 778 |
# File 'lib/amq/protocol/client.rb', line 772 def self.encode(channel, active) buffer = @packed_indexes.dup bit_buffer = 0 bit_buffer = bit_buffer | (1 << 0) if active buffer << [bit_buffer].pack(PACK_CHAR) MethodFrame.new(buffer, channel) end |
.has_content? ⇒ Boolean
766 767 768 |
# File 'lib/amq/protocol/client.rb', line 766 def self.has_content? false end |