Class: WAZ::Queues::Message
- Inherits:
-
Object
- Object
- WAZ::Queues::Message
- Defined in:
- lib/waz/queues/message.rb
Instance Attribute Summary collapse
-
#expiration_time ⇒ Object
Returns the value of attribute expiration_time.
-
#insertion_time ⇒ Object
Returns the value of attribute insertion_time.
-
#message_id ⇒ Object
Returns the value of attribute message_id.
-
#message_text ⇒ Object
Returns the value of attribute message_text.
-
#pop_receipt ⇒ Object
Returns the value of attribute pop_receipt.
-
#time_next_visible ⇒ Object
Returns the value of attribute time_next_visible.
Instance Method Summary collapse
- #destroy! ⇒ Object
-
#initialize(params = {}) ⇒ Message
constructor
A new instance of Message.
- #queue_name ⇒ Object
Constructor Details
#initialize(params = {}) ⇒ Message
Returns a new instance of Message.
5 6 7 8 9 10 11 12 13 |
# File 'lib/waz/queues/message.rb', line 5 def initialize(params = {}) self. = params[:message_id] self. = params[:message_text] self.pop_receipt = params[:pop_receipt] self.expiration_time = params[:expiration_time] self.insertion_time = params[:insertion_time] self.time_next_visible = params[:time_next_visible] @queue_name = params[:queue_name] end |
Instance Attribute Details
#expiration_time ⇒ Object
Returns the value of attribute expiration_time.
4 5 6 |
# File 'lib/waz/queues/message.rb', line 4 def expiration_time @expiration_time end |
#insertion_time ⇒ Object
Returns the value of attribute insertion_time.
4 5 6 |
# File 'lib/waz/queues/message.rb', line 4 def insertion_time @insertion_time end |
#message_id ⇒ Object
Returns the value of attribute message_id.
4 5 6 |
# File 'lib/waz/queues/message.rb', line 4 def @message_id end |
#message_text ⇒ Object
Returns the value of attribute message_text.
4 5 6 |
# File 'lib/waz/queues/message.rb', line 4 def @message_text end |
#pop_receipt ⇒ Object
Returns the value of attribute pop_receipt.
4 5 6 |
# File 'lib/waz/queues/message.rb', line 4 def pop_receipt @pop_receipt end |
#time_next_visible ⇒ Object
Returns the value of attribute time_next_visible.
4 5 6 |
# File 'lib/waz/queues/message.rb', line 4 def time_next_visible @time_next_visible end |
Instance Method Details
#destroy! ⇒ Object
19 20 21 22 |
# File 'lib/waz/queues/message.rb', line 19 def destroy! raise WAZ::Queues::InvalidOperation if pop_receipt.nil? service_instance.(queue_name, , pop_receipt) end |
#queue_name ⇒ Object
15 16 17 |
# File 'lib/waz/queues/message.rb', line 15 def queue_name return @queue_name end |