Class: AMQ::Protocol::Basic::Deliver
- Defined in:
- lib/amq/protocol/client.rb
Instance Attribute Summary collapse
-
#consumer_tag ⇒ Object
readonly
Returns the value of attribute consumer_tag.
-
#delivery_tag ⇒ Object
readonly
Returns the value of attribute delivery_tag.
-
#exchange ⇒ Object
readonly
Returns the value of attribute exchange.
-
#redelivered ⇒ Object
readonly
Returns the value of attribute redelivered.
-
#routing_key ⇒ Object
readonly
Returns the value of attribute routing_key.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(consumer_tag, delivery_tag, redelivered, exchange, routing_key) ⇒ Deliver
constructor
A new instance of Deliver.
Methods inherited from Method
encode_body, index, inherited, instantiate, method_id, methods, name, split_headers
Constructor Details
#initialize(consumer_tag, delivery_tag, redelivered, exchange, routing_key) ⇒ Deliver
Returns a new instance of Deliver.
1874 1875 1876 1877 1878 1879 1880 |
# File 'lib/amq/protocol/client.rb', line 1874 def initialize(consumer_tag, delivery_tag, redelivered, exchange, routing_key) @consumer_tag = consumer_tag @delivery_tag = delivery_tag @redelivered = redelivered @exchange = exchange @routing_key = routing_key end |
Instance Attribute Details
#consumer_tag ⇒ Object (readonly)
Returns the value of attribute consumer_tag.
1873 1874 1875 |
# File 'lib/amq/protocol/client.rb', line 1873 def consumer_tag @consumer_tag end |
#delivery_tag ⇒ Object (readonly)
Returns the value of attribute delivery_tag.
1873 1874 1875 |
# File 'lib/amq/protocol/client.rb', line 1873 def delivery_tag @delivery_tag end |
#exchange ⇒ Object (readonly)
Returns the value of attribute exchange.
1873 1874 1875 |
# File 'lib/amq/protocol/client.rb', line 1873 def exchange @exchange end |
#redelivered ⇒ Object (readonly)
Returns the value of attribute redelivered.
1873 1874 1875 |
# File 'lib/amq/protocol/client.rb', line 1873 def redelivered @redelivered end |
#routing_key ⇒ Object (readonly)
Returns the value of attribute routing_key.
1873 1874 1875 |
# File 'lib/amq/protocol/client.rb', line 1873 def routing_key @routing_key end |
Class Method Details
.decode(data) ⇒ Object
1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 |
# File 'lib/amq/protocol/client.rb', line 1851 def self.decode(data) offset = 0 length = data[offset, 1].unpack(PACK_CHAR).first offset += 1 consumer_tag = data[offset, length] offset += length delivery_tag = AMQ::Hacks.unpack_uint64_big_endian(data[offset, 8]).first offset += 8 bit_buffer = data[offset, 1].unpack(PACK_CHAR).first offset += 1 redelivered = (bit_buffer & (1 << 0)) != 0 length = data[offset, 1].unpack(PACK_CHAR).first offset += 1 exchange = data[offset, length] offset += length length = data[offset, 1].unpack(PACK_CHAR).first offset += 1 routing_key = data[offset, length] offset += length self.new(consumer_tag, delivery_tag, redelivered, exchange, routing_key) end |
.has_content? ⇒ Boolean
1882 1883 1884 |
# File 'lib/amq/protocol/client.rb', line 1882 def self.has_content? true end |