Class: MessageDriver::Message::Base
- Inherits:
-
Object
- Object
- MessageDriver::Message::Base
- Defined in:
- lib/message_driver/message.rb
Direct Known Subclasses
Adapters::BunnyAdapter::Message, Adapters::InMemoryAdapter::Message, Adapters::StompAdapter::Message
Instance Attribute Summary collapse
-
#body ⇒ Object
readonly
Returns the value of attribute body.
-
#ctx ⇒ Object
readonly
Returns the value of attribute ctx.
-
#destination ⇒ Object
readonly
Returns the value of attribute destination.
-
#headers ⇒ Object
readonly
Returns the value of attribute headers.
-
#properties ⇒ Object
readonly
Returns the value of attribute properties.
-
#raw_body ⇒ Object
readonly
Returns the value of attribute raw_body.
Instance Method Summary collapse
- #ack(options = {}) ⇒ Object
-
#initialize(ctx, destination, body, headers, properties, raw_body = nil) ⇒ Base
constructor
A new instance of Base.
- #nack(options = {}) ⇒ Object
Constructor Details
#initialize(ctx, destination, body, headers, properties, raw_body = nil) ⇒ Base
Returns a new instance of Base.
8 9 10 11 12 13 14 15 |
# File 'lib/message_driver/message.rb', line 8 def initialize(ctx, destination, body, headers, properties, raw_body = nil) @ctx = ctx @destination = destination @body = body @headers = headers @properties = properties @raw_body = raw_body.nil? ? body : raw_body end |
Instance Attribute Details
#body ⇒ Object (readonly)
Returns the value of attribute body.
6 7 8 |
# File 'lib/message_driver/message.rb', line 6 def body @body end |
#ctx ⇒ Object (readonly)
Returns the value of attribute ctx.
6 7 8 |
# File 'lib/message_driver/message.rb', line 6 def ctx @ctx end |
#destination ⇒ Object (readonly)
Returns the value of attribute destination.
6 7 8 |
# File 'lib/message_driver/message.rb', line 6 def destination @destination end |
#headers ⇒ Object (readonly)
Returns the value of attribute headers.
6 7 8 |
# File 'lib/message_driver/message.rb', line 6 def headers @headers end |
#properties ⇒ Object (readonly)
Returns the value of attribute properties.
6 7 8 |
# File 'lib/message_driver/message.rb', line 6 def properties @properties end |
#raw_body ⇒ Object (readonly)
Returns the value of attribute raw_body.
6 7 8 |
# File 'lib/message_driver/message.rb', line 6 def raw_body @raw_body end |
Instance Method Details
#ack(options = {}) ⇒ Object
17 18 19 20 21 22 23 |
# File 'lib/message_driver/message.rb', line 17 def ack( = {}) if ctx.supports_client_acks? ctx.(self, ) else logger.debug('this adapter does not support client acks') end end |
#nack(options = {}) ⇒ Object
25 26 27 28 29 30 31 |
# File 'lib/message_driver/message.rb', line 25 def nack( = {}) if ctx.supports_client_acks? ctx.(self, ) else logger.debug('this adapter does not support client acks') end end |