Class: InsoundApi::Response
- Inherits:
-
Object
- Object
- InsoundApi::Response
- Defined in:
- lib/insound_api/response.rb
Instance Attribute Summary collapse
-
#doc ⇒ Object
readonly
Returns the value of attribute doc.
-
#raw_xml ⇒ Object
readonly
Returns the value of attribute raw_xml.
-
#request ⇒ Object
readonly
Returns the value of attribute request.
-
#results ⇒ Object
readonly
Returns the value of attribute results.
Instance Method Summary collapse
- #errors ⇒ Object
- #errors? ⇒ Boolean
-
#initialize(opts = {}) ⇒ Response
constructor
A new instance of Response.
Constructor Details
Instance Attribute Details
#doc ⇒ Object (readonly)
Returns the value of attribute doc.
7 8 9 |
# File 'lib/insound_api/response.rb', line 7 def doc @doc end |
#raw_xml ⇒ Object (readonly)
Returns the value of attribute raw_xml.
7 8 9 |
# File 'lib/insound_api/response.rb', line 7 def raw_xml @raw_xml end |
#request ⇒ Object (readonly)
Returns the value of attribute request.
7 8 9 |
# File 'lib/insound_api/response.rb', line 7 def request @request end |
#results ⇒ Object (readonly)
Returns the value of attribute results.
7 8 9 |
# File 'lib/insound_api/response.rb', line 7 def results @results end |
Instance Method Details
#errors ⇒ Object
20 21 22 23 24 25 26 27 28 29 |
# File 'lib/insound_api/response.rb', line 20 def errors unless @errors @errors = doc.css('errors request_error').map{ |node| code = node.css('error_code').first.inner_html text = node.css('error_text').first.inner_html {:code => code, :text => text} } end @errors end |
#errors? ⇒ Boolean
16 17 18 |
# File 'lib/insound_api/response.rb', line 16 def errors? errors.any? end |