Class: AMQ::Protocol::Basic::Return
- Defined in:
- lib/amq/protocol/client.rb
Instance Attribute Summary collapse
-
#exchange ⇒ Object
readonly
Returns the value of attribute exchange.
-
#reply_code ⇒ Object
readonly
Returns the value of attribute reply_code.
-
#reply_text ⇒ Object
readonly
Returns the value of attribute reply_text.
-
#routing_key ⇒ Object
readonly
Returns the value of attribute routing_key.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(reply_code, reply_text, exchange, routing_key) ⇒ Return
constructor
A new instance of Return.
Methods inherited from Method
encode_body, index, inherited, instantiate, method_id, methods, name, split_headers
Constructor Details
#initialize(reply_code, reply_text, exchange, routing_key) ⇒ Return
Returns a new instance of Return.
1708 1709 1710 1711 1712 1713 |
# File 'lib/amq/protocol/client.rb', line 1708 def initialize(reply_code, reply_text, exchange, routing_key) @reply_code = reply_code @reply_text = reply_text @exchange = exchange @routing_key = routing_key end |
Instance Attribute Details
#exchange ⇒ Object (readonly)
Returns the value of attribute exchange.
1707 1708 1709 |
# File 'lib/amq/protocol/client.rb', line 1707 def exchange @exchange end |
#reply_code ⇒ Object (readonly)
Returns the value of attribute reply_code.
1707 1708 1709 |
# File 'lib/amq/protocol/client.rb', line 1707 def reply_code @reply_code end |
#reply_text ⇒ Object (readonly)
Returns the value of attribute reply_text.
1707 1708 1709 |
# File 'lib/amq/protocol/client.rb', line 1707 def reply_text @reply_text end |
#routing_key ⇒ Object (readonly)
Returns the value of attribute routing_key.
1707 1708 1709 |
# File 'lib/amq/protocol/client.rb', line 1707 def routing_key @routing_key end |
Class Method Details
.decode(data) ⇒ Object
1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 |
# File 'lib/amq/protocol/client.rb', line 1688 def self.decode(data) offset = 0 reply_code = data[offset, 2].unpack(PACK_UINT16).first offset += 2 length = data[offset, 1].unpack(PACK_CHAR).first offset += 1 reply_text = data[offset, length] offset += length 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(reply_code, reply_text, exchange, routing_key) end |
.has_content? ⇒ Boolean
1715 1716 1717 |
# File 'lib/amq/protocol/client.rb', line 1715 def self.has_content? true end |