Class: EventHub::Adapters::Test::Message
- Defined in:
- lib/event_hub/adapters/test/message.rb
Instance Attribute Summary collapse
-
#attributes ⇒ Object
readonly
Returns the value of attribute attributes.
-
#body ⇒ Object
readonly
Returns the value of attribute body.
Instance Method Summary collapse
- #ack ⇒ Object
- #ack? ⇒ Boolean
- #event ⇒ Object
-
#initialize(event, queue, attributes = {}) ⇒ Message
constructor
A new instance of Message.
- #reject ⇒ Object
- #rejected? ⇒ Boolean
- #version ⇒ Object
Methods inherited from Message
Constructor Details
#initialize(event, queue, attributes = {}) ⇒ Message
Returns a new instance of Message.
7 8 9 10 11 12 |
# File 'lib/event_hub/adapters/test/message.rb', line 7 def initialize(event, queue, attributes = {}) @event = event @body = event.body @attributes = attributes @queue = queue end |
Instance Attribute Details
#attributes ⇒ Object (readonly)
Returns the value of attribute attributes.
14 15 16 |
# File 'lib/event_hub/adapters/test/message.rb', line 14 def attributes @attributes end |
#body ⇒ Object (readonly)
Returns the value of attribute body.
14 15 16 |
# File 'lib/event_hub/adapters/test/message.rb', line 14 def body @body end |
Instance Method Details
#ack ⇒ Object
24 25 26 27 |
# File 'lib/event_hub/adapters/test/message.rb', line 24 def ack @ack = true @queue.delete(self) end |
#ack? ⇒ Boolean
34 35 36 |
# File 'lib/event_hub/adapters/test/message.rb', line 34 def ack? !!@ack end |
#event ⇒ Object
16 17 18 |
# File 'lib/event_hub/adapters/test/message.rb', line 16 def event @event.class.event end |
#reject ⇒ Object
29 30 31 32 |
# File 'lib/event_hub/adapters/test/message.rb', line 29 def reject @rejected = true @queue.delete(self) end |
#rejected? ⇒ Boolean
38 39 40 |
# File 'lib/event_hub/adapters/test/message.rb', line 38 def rejected? !!@rejected end |
#version ⇒ Object
20 21 22 |
# File 'lib/event_hub/adapters/test/message.rb', line 20 def version @event.class.version end |