Class: OAS::AdXML::Response
Instance Attribute Summary collapse
-
#error_code ⇒ Object
readonly
Returns the value of attribute error_code.
-
#error_text ⇒ Object
readonly
Returns the value of attribute error_text.
Attributes included from Utils
Instance Method Summary collapse
-
#initialize(doc) ⇒ Response
constructor
A new instance of Response.
- #success? ⇒ Boolean
Methods included from Utils
Constructor Details
#initialize(doc) ⇒ Response
Returns a new instance of Response.
43 44 45 46 47 48 49 50 51 |
# File 'lib/oas/adxml.rb', line 43 def initialize(doc) @doc = doc @error_code = @error_text = nil error = @doc.xpath('.//Exception').first rescue nil if error @error_code = error['errorCode'].to_i @error_text = error.text end end |
Instance Attribute Details
#error_code ⇒ Object (readonly)
Returns the value of attribute error_code.
40 41 42 |
# File 'lib/oas/adxml.rb', line 40 def error_code @error_code end |
#error_text ⇒ Object (readonly)
Returns the value of attribute error_text.
41 42 43 |
# File 'lib/oas/adxml.rb', line 41 def error_text @error_text end |
Instance Method Details
#success? ⇒ Boolean
53 54 55 |
# File 'lib/oas/adxml.rb', line 53 def success? !error_code end |