Class: EveApp::XmlApi::Calls::AssetList
- Defined in:
- lib/eve_app/xml_api/calls.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#assets ⇒ Object
readonly
Returns the value of attribute assets.
Attributes inherited from Base
Instance Method Summary collapse
-
#initialize(xml) ⇒ AssetList
constructor
A new instance of AssetList.
- #parse_rows(rows, parent = nil) ⇒ Object
Methods inherited from Base
Constructor Details
#initialize(xml) ⇒ AssetList
Returns a new instance of AssetList.
130 131 132 133 134 |
# File 'lib/eve_app/xml_api/calls.rb', line 130 def initialize(xml) @assets = [] parse_rows(xml.search("//rowset[@name='assets']/row")) @cached_until = (xml.search('cachedUntil').text + 'Z').to_time end |
Instance Attribute Details
#assets ⇒ Object (readonly)
Returns the value of attribute assets.
128 129 130 |
# File 'lib/eve_app/xml_api/calls.rb', line 128 def assets @assets end |
Instance Method Details
#parse_rows(rows, parent = nil) ⇒ Object
136 137 138 139 140 141 142 143 144 |
# File 'lib/eve_app/xml_api/calls.rb', line 136 def parse_rows(rows, parent=nil) rows.each do |container| asset = Classes::Asset.new(container) asset.container = container.children.any? asset.parent = parent if parent parse_rows(container.search("rowset/row"), asset) if asset.container? @assets << asset end end |