Class: GorgonAMQ::Protocol::Basic::Nack
- Defined in:
- lib/gorgon_amq-protocol/lib/gorgon_amq/protocol/client.rb
Instance Attribute Summary collapse
-
#delivery_tag ⇒ Object
readonly
Returns the value of attribute delivery_tag.
-
#multiple ⇒ Object
readonly
Returns the value of attribute multiple.
-
#requeue ⇒ Object
readonly
Returns the value of attribute requeue.
Class Method Summary collapse
- .decode(data) ⇒ Object
-
.encode(channel, delivery_tag, multiple, requeue) ⇒ Object
[u’delivery_tag = false’, u’multiple = false’, u’requeue = true’].
- .has_content? ⇒ Boolean
Instance Method Summary collapse
-
#initialize(delivery_tag, multiple, requeue) ⇒ Nack
constructor
A new instance of Nack.
Methods inherited from Method
encode_body, index, inherited, instantiate, method_id, methods, name, split_headers
Constructor Details
#initialize(delivery_tag, multiple, requeue) ⇒ Nack
Returns a new instance of Nack.
2082 2083 2084 2085 2086 |
# File 'lib/gorgon_amq-protocol/lib/gorgon_amq/protocol/client.rb', line 2082 def initialize(delivery_tag, multiple, requeue) @delivery_tag = delivery_tag @multiple = multiple @requeue = requeue end |
Instance Attribute Details
#delivery_tag ⇒ Object (readonly)
Returns the value of attribute delivery_tag.
2081 2082 2083 |
# File 'lib/gorgon_amq-protocol/lib/gorgon_amq/protocol/client.rb', line 2081 def delivery_tag @delivery_tag end |
#multiple ⇒ Object (readonly)
Returns the value of attribute multiple.
2081 2082 2083 |
# File 'lib/gorgon_amq-protocol/lib/gorgon_amq/protocol/client.rb', line 2081 def multiple @multiple end |
#requeue ⇒ Object (readonly)
Returns the value of attribute requeue.
2081 2082 2083 |
# File 'lib/gorgon_amq-protocol/lib/gorgon_amq/protocol/client.rb', line 2081 def requeue @requeue end |
Class Method Details
.decode(data) ⇒ Object
2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 |
# File 'lib/gorgon_amq-protocol/lib/gorgon_amq/protocol/client.rb', line 2070 def self.decode(data) offset = 0 delivery_tag = GorgonAMQ::Pack.unpack_uint64_big_endian(data[offset, 8]).first offset += 8 bit_buffer = data[offset, 1].unpack(PACK_CHAR).first offset += 1 multiple = (bit_buffer & (1 << 0)) != 0 requeue = (bit_buffer & (1 << 1)) != 0 self.new(delivery_tag, multiple, requeue) end |
.encode(channel, delivery_tag, multiple, requeue) ⇒ Object
- u’delivery_tag = false’, u’multiple = false’, u’requeue = true’
2094 2095 2096 2097 2098 2099 2100 2101 2102 |
# File 'lib/gorgon_amq-protocol/lib/gorgon_amq/protocol/client.rb', line 2094 def self.encode(channel, delivery_tag, multiple, requeue) buffer = @packed_indexes.dup buffer << GorgonAMQ::Pack.pack_uint64_big_endian(delivery_tag) bit_buffer = 0 bit_buffer = bit_buffer | (1 << 0) if multiple bit_buffer = bit_buffer | (1 << 1) if requeue buffer << [bit_buffer].pack(PACK_CHAR) MethodFrame.new(buffer, channel) end |
.has_content? ⇒ Boolean
2088 2089 2090 |
# File 'lib/gorgon_amq-protocol/lib/gorgon_amq/protocol/client.rb', line 2088 def self.has_content? false end |