Class: SmsSendValidationResponse
- Inherits:
-
BasicResponse
- Object
- BasicResponse
- SmsSendValidationResponse
- Defined in:
- lib/sms_service/sms_validation_response.rb
Overview
Representing a response from the SmsService
.
Instance Attribute Summary
Attributes inherited from BasicResponse
Instance Method Summary collapse
-
#initialize(response_xml, raise_exception_on_error = true) ⇒ SmsSendValidationResponse
constructor
Constructor.
Methods inherited from BasicResponse
#inizialize, #raise_on_error, #to_s
Constructor Details
#initialize(response_xml, raise_exception_on_error = true) ⇒ SmsSendValidationResponse
Constructor.
Parameters
response_xml
-
Xml as returned by a
sms_status
-method call. raise_exception_on_error
-
Xml as returned by a
sms_status
-method call.
10 11 12 13 14 15 16 17 |
# File 'lib/sms_service/sms_validation_response.rb', line 10 def initialize(response_xml, raise_exception_on_error = true) doc = response_xml.document @error_code = doc.xpath("//statusCode").to_s @error_message = doc.xpath("//statusMessage").to_s raise_on_error(response_xml) if raise_exception_on_error end |