Class: EveApp::XmlApi::Calls::Base
- Inherits:
-
Object
- Object
- EveApp::XmlApi::Calls::Base
- Defined in:
- lib/eve_app/xml_api/calls.rb
Direct Known Subclasses
AccountBalance, AssetList, Blueprints, Characters, CorporateMemberSecurity, CorporateMemberTracking, CorporateTitles, ErrorResponse, IndustryJobs, MarketOrders, Sheet, WalletJournals, WalletTransactions
Instance Attribute Summary collapse
-
#cached_until ⇒ Object
Returns the value of attribute cached_until.
-
#results ⇒ Object
readonly
Returns the value of attribute results.
-
#xml ⇒ Object
readonly
Returns the value of attribute xml.
Instance Method Summary collapse
- #error? ⇒ Boolean
- #ids ⇒ Object
-
#initialize(xml = nil) ⇒ Base
constructor
A new instance of Base.
- #merge(call) ⇒ Object
Constructor Details
#initialize(xml = nil) ⇒ Base
Returns a new instance of Base.
16 17 18 19 20 21 22 23 24 |
# File 'lib/eve_app/xml_api/calls.rb', line 16 def initialize(xml=nil) if xml @xml = xml @results = xml.search(selector).map { |row| class_name.new(row) } @cached_until = (xml.search('cachedUntil').text + 'Z').to_time else @results = [] end end |
Instance Attribute Details
#cached_until ⇒ Object
Returns the value of attribute cached_until.
12 13 14 |
# File 'lib/eve_app/xml_api/calls.rb', line 12 def cached_until @cached_until end |
#results ⇒ Object (readonly)
Returns the value of attribute results.
11 12 13 |
# File 'lib/eve_app/xml_api/calls.rb', line 11 def results @results end |
#xml ⇒ Object (readonly)
Returns the value of attribute xml.
11 12 13 |
# File 'lib/eve_app/xml_api/calls.rb', line 11 def xml @xml end |
Instance Method Details
#error? ⇒ Boolean
34 35 36 |
# File 'lib/eve_app/xml_api/calls.rb', line 34 def error? false end |
#ids ⇒ Object
30 31 32 |
# File 'lib/eve_app/xml_api/calls.rb', line 30 def ids @results.map(&:id) end |
#merge(call) ⇒ Object
26 27 28 |
# File 'lib/eve_app/xml_api/calls.rb', line 26 def merge(call) @results += call.results end |