Class: SoapyYandex::Response

Inherits:
Object
  • Object
show all
Defined in:
lib/soapy_yandex/response.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#xmlObject (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

#attributesObject



22
23
24
# File 'lib/soapy_yandex/response.rb', line 22

def attributes
  doc.nodes.first.attributes
end

#error?Boolean

Returns:

  • (Boolean)


14
15
16
# File 'lib/soapy_yandex/response.rb', line 14

def error?
  attributes[:status].to_i == 3
end

#error_codeObject



18
19
20
# File 'lib/soapy_yandex/response.rb', line 18

def error_code
  attributes[:error].to_i
end

#success?Boolean

Returns:

  • (Boolean)


10
11
12
# File 'lib/soapy_yandex/response.rb', line 10

def success?
  attributes[:status].to_i == 0
end