Class: SQSMessage
- Inherits:
-
Object
- Object
- SQSMessage
- Defined in:
- lib/sqs_async/sqs_message.rb
Instance Attribute Summary collapse
-
#body ⇒ Object
Returns the value of attribute body.
-
#md5_of_body ⇒ Object
Returns the value of attribute md5_of_body.
-
#message_id ⇒ Object
Returns the value of attribute message_id.
-
#receipt_handle ⇒ Object
Returns the value of attribute receipt_handle.
Class Method Summary collapse
Instance Attribute Details
#body ⇒ Object
Returns the value of attribute body.
7 8 9 |
# File 'lib/sqs_async/sqs_message.rb', line 7 def body @body end |
#md5_of_body ⇒ Object
Returns the value of attribute md5_of_body.
7 8 9 |
# File 'lib/sqs_async/sqs_message.rb', line 7 def md5_of_body @md5_of_body end |
#message_id ⇒ Object
Returns the value of attribute message_id.
7 8 9 |
# File 'lib/sqs_async/sqs_message.rb', line 7 def @message_id end |
#receipt_handle ⇒ Object
Returns the value of attribute receipt_handle.
7 8 9 |
# File 'lib/sqs_async/sqs_message.rb', line 7 def receipt_handle @receipt_handle end |
Class Method Details
.parse(xml) ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/sqs_async/sqs_message.rb', line 9 def self.parse(xml) doc = Nokogiri::XML(xml) = [] doc.search("Message").each do || s = SQSMessage.new s.body = .at("Body").text.strip s.md5_of_body = .at("MD5OfBody").text.strip s. = .at("MessageId").text.strip s.receipt_handle = .at("ReceiptHandle").text.strip << s end end |