Class: SoapyYandex::Response
- Inherits:
-
Object
- Object
- SoapyYandex::Response
- Defined in:
- lib/soapy_yandex/response.rb
Instance Attribute Summary collapse
-
#xml ⇒ Object
readonly
Returns the value of attribute xml.
Instance Method Summary collapse
- #attributes ⇒ Object
- #error? ⇒ Boolean
- #error_code ⇒ Object
-
#initialize(xml) ⇒ Response
constructor
A new instance of Response.
- #success? ⇒ Boolean
Constructor Details
#initialize(xml) ⇒ Response
Returns a new instance of Response.
6 7 8 |
# File 'lib/soapy_yandex/response.rb', line 6 def initialize(xml) @xml = xml end |
Instance Attribute Details
#xml ⇒ Object (readonly)
Returns the value of attribute xml.
4 5 6 |
# File 'lib/soapy_yandex/response.rb', line 4 def xml @xml end |
Instance Method Details
#attributes ⇒ Object
22 23 24 |
# File 'lib/soapy_yandex/response.rb', line 22 def attributes doc.nodes.first.attributes end |
#error? ⇒ Boolean
14 15 16 |
# File 'lib/soapy_yandex/response.rb', line 14 def error? attributes[:status].to_i == 3 end |
#error_code ⇒ Object
18 19 20 |
# File 'lib/soapy_yandex/response.rb', line 18 def error_code attributes[:error].to_i end |
#success? ⇒ Boolean
10 11 12 |
# File 'lib/soapy_yandex/response.rb', line 10 def success? attributes[:status].to_i == 0 end |