Class: EveApp::XmlApi::Calls::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/eve_app/xml_api/calls.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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_untilObject

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

#resultsObject (readonly)

Returns the value of attribute results.



11
12
13
# File 'lib/eve_app/xml_api/calls.rb', line 11

def results
  @results
end

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

Returns:

  • (Boolean)


34
35
36
# File 'lib/eve_app/xml_api/calls.rb', line 34

def error?
  false
end

#idsObject



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