Class: AMQ::Protocol::Channel::FlowOk

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) ⇒ FlowOk

Returns a new instance of FlowOk.



687
688
689
# File 'lib/amq/protocol/client.rb', line 687

def initialize(active)
  @active = active
end

Instance Attribute Details

#activeObject (readonly)

Returns the value of attribute active.



686
687
688
# File 'lib/amq/protocol/client.rb', line 686

def active
  @active
end

Class Method Details

.decode(data) ⇒ Object

Returns:



678
679
680
681
682
683
684
# File 'lib/amq/protocol/client.rb', line 678

def self.decode(data)
  offset = 0
  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

“active = nil”

Returns:



697
698
699
700
701
702
703
704
# File 'lib/amq/protocol/client.rb', line 697

def self.encode(channel, active)
  buffer = ""
  buffer << @packed_indexes
  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)


691
692
693
# File 'lib/amq/protocol/client.rb', line 691

def self.has_content?
  false
end