Class: SQSSendMessageResponse

Inherits:
Object
  • Object
show all
Defined in:
lib/sqs_async/sqs_send_message_response.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#bodyObject

Returns the value of attribute body.



7
8
9
# File 'lib/sqs_async/sqs_send_message_response.rb', line 7

def body
  @body
end

#md5_of_bodyObject

Returns the value of attribute md5_of_body.



7
8
9
# File 'lib/sqs_async/sqs_send_message_response.rb', line 7

def md5_of_body
  @md5_of_body
end

#message_idObject

Returns the value of attribute message_id.



7
8
9
# File 'lib/sqs_async/sqs_send_message_response.rb', line 7

def message_id
  @message_id
end

#receipt_handleObject

Returns the value of attribute receipt_handle.



7
8
9
# File 'lib/sqs_async/sqs_send_message_response.rb', line 7

def receipt_handle
  @receipt_handle
end

Class Method Details

.parse(original_body, xml) ⇒ Object



9
10
11
12
13
14
15
16
17
18
# File 'lib/sqs_async/sqs_send_message_response.rb', line 9

def self.parse(original_body, xml)
  doc = Nokogiri::XML(xml)
  message = SQSMessage.new
  doc.search("SendMessageResult").each do |message_element|
    message.body = original_body || ""
    message.md5_of_body = message_element.at("MD5OfMessageBody").text.strip
    message.message_id = message_element.at("MessageId").text.strip
  end
  message
end