Class: Rufus::SQS::Message
- Inherits:
-
Object
- Object
- Rufus::SQS::Message
- Defined in:
- lib/rufus/sqs.rb
Overview
An SQS message (after its creation).
Instance Attribute Summary collapse
-
#message_body ⇒ Object
readonly
Returns the value of attribute message_body.
-
#message_id ⇒ Object
readonly
Returns the value of attribute message_id.
-
#queue ⇒ Object
readonly
Returns the value of attribute queue.
Instance Method Summary collapse
-
#delete ⇒ Object
Connects to the queue service and deletes this message in its queue.
-
#initialize(queue, xml_element) ⇒ Message
constructor
A new instance of Message.
Constructor Details
#initialize(queue, xml_element) ⇒ Message
Returns a new instance of Message.
52 53 54 55 56 57 |
# File 'lib/rufus/sqs.rb', line 52 def initialize (queue, xml_element) @queue = queue @message_id = SQS::get_element_text(xml_element, "MessageId") @message_body = SQS::get_element_text(xml_element, "MessageBody") end |
Instance Attribute Details
#message_body ⇒ Object (readonly)
Returns the value of attribute message_body.
50 51 52 |
# File 'lib/rufus/sqs.rb', line 50 def @message_body end |
#message_id ⇒ Object (readonly)
Returns the value of attribute message_id.
50 51 52 |
# File 'lib/rufus/sqs.rb', line 50 def @message_id end |
#queue ⇒ Object (readonly)
Returns the value of attribute queue.
50 51 52 |
# File 'lib/rufus/sqs.rb', line 50 def queue @queue end |
Instance Method Details
#delete ⇒ Object
Connects to the queue service and deletes this message in its queue.
62 63 64 65 |
# File 'lib/rufus/sqs.rb', line 62 def delete @queue.queue_service.(@queue, @message_id) end |