Class: AMQ::Protocol::Channel::Flow

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Method

encode_body, index, inherited, instantiate, method_id, methods, name, split_headers

Constructor Details

#initialize(active) ⇒ Flow

Returns a new instance of Flow.



725
726
727
# File 'lib/amq/protocol/client.rb', line 725

def initialize(active)
  @active = active
end

Instance Attribute Details

#activeObject (readonly)

Returns the value of attribute active.



724
725
726
# File 'lib/amq/protocol/client.rb', line 724

def active
  @active
end

Class Method Details

.decode(data) ⇒ Object

Returns:



716
717
718
719
720
721
722
# File 'lib/amq/protocol/client.rb', line 716

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’

Returns:



735
736
737
738
739
740
741
# File 'lib/amq/protocol/client.rb', line 735

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

Returns:

  • (Boolean)


729
730
731
# File 'lib/amq/protocol/client.rb', line 729

def self.has_content?
  false
end