Class: Eve::API::Response
- Inherits:
-
Object
- Object
- Eve::API::Response
- Includes:
- Result
- Defined in:
- lib/eve/api/response.rb
Defined Under Namespace
Modules: Result Classes: Row, Rowset
Instance Attribute Summary collapse
-
#api_version ⇒ Object
(also: #apiVersion)
readonly
Returns the value of attribute api_version.
-
#content ⇒ Object
readonly
Returns the value of attribute content.
-
#rowsets ⇒ Object
readonly
Returns the value of attribute rowsets.
Instance Method Summary collapse
-
#initialize(xml, options = {}) ⇒ Response
constructor
A new instance of Response.
Methods included from Result
#[], #all_fields, #delegate_to_child, #delegate_to_rowset, #literal_value_for, #parse_children, #to_hash, #to_yaml
Constructor Details
#initialize(xml, options = {}) ⇒ Response
Returns a new instance of Response.
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/eve/api/response.rb', line 13 def initialize(xml, = {}) @options = @rowsets = [] if xml.kind_of? String @xml = Nokogiri::XML(xml).root else @xml = xml end unless [:process_xml] == false @api_version = @xml.attributes['version'].value parse_children @xml result = @xml.xpath("//result")[0] parse_children result if result all_fields << 'api_version' all_fields.delete 'result' end end |
Instance Attribute Details
#api_version ⇒ Object (readonly) Also known as: apiVersion
Returns the value of attribute api_version.
10 11 12 |
# File 'lib/eve/api/response.rb', line 10 def api_version @api_version end |
#content ⇒ Object (readonly)
Returns the value of attribute content.
10 11 12 |
# File 'lib/eve/api/response.rb', line 10 def content @content end |
#rowsets ⇒ Object (readonly)
Returns the value of attribute rowsets.
9 10 11 |
# File 'lib/eve/api/response.rb', line 9 def rowsets @rowsets end |