Class: AMQ::Protocol::Queue::DeclareOk

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(queue, message_count, consumer_count) ⇒ DeclareOk

Returns a new instance of DeclareOk.



1047
1048
1049
1050
1051
# File 'lib/amq/protocol/client.rb', line 1047

def initialize(queue, message_count, consumer_count)
  @queue = queue
  @message_count = message_count
  @consumer_count = consumer_count
end

Instance Attribute Details

#consumer_countObject (readonly)

Returns the value of attribute consumer_count.



1046
1047
1048
# File 'lib/amq/protocol/client.rb', line 1046

def consumer_count
  @consumer_count
end

#message_countObject (readonly)

Returns the value of attribute message_count.



1046
1047
1048
# File 'lib/amq/protocol/client.rb', line 1046

def message_count
  @message_count
end

#queueObject (readonly)

Returns the value of attribute queue.



1046
1047
1048
# File 'lib/amq/protocol/client.rb', line 1046

def queue
  @queue
end

Class Method Details

.decode(data) ⇒ Object

Returns:



1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
# File 'lib/amq/protocol/client.rb', line 1033

def self.decode(data)
  offset = 0
  length = data[offset, 1].unpack(PACK_CHAR).first
  offset += 1
  queue = data[offset, length]
  offset += length
  message_count = data[offset, 4].unpack(PACK_UINT32).first
  offset += 4
  consumer_count = data[offset, 4].unpack(PACK_UINT32).first
  offset += 4
  self.new(queue, message_count, consumer_count)
end

.has_content?Boolean

Returns:

  • (Boolean)


1053
1054
1055
# File 'lib/amq/protocol/client.rb', line 1053

def self.has_content?
  false
end