Class: Greeve::Eve::AllianceList

Inherits:
BaseItem
  • Object
show all
Defined in:
lib/greeve/eve/alliance_list.rb

Overview

Returns active alliances in New Eden and their member corporations.

Attributes collapse

Instance Method Summary collapse

Methods inherited from BaseItem

attribute, #cache_expired?, #cached_until, endpoint, #inspect, namespace, #refresh, rowset, #to_s

Methods included from Helpers::AttributeToHash

#to_h

Constructor Details

#initialize(version, opts = {}) ⇒ AllianceList

Returns a new instance of AllianceList

Parameters:

  • version (Integer)

    EVE Alliance List

Raises:

  • (ArgumentError)


21
22
23
24
25
26
# File 'lib/greeve/eve/alliance_list.rb', line 21

def initialize(version, opts = {})
  raise ArgumentError, "not implemented, use version=1" if version == 0

  opts[:query_params] = { "version" => version }
  super(opts)
end

Instance Method Details

#alliancesGreeve::Rowset

Parameters:

  • name (String)
  • short_name (String)
  • alliance_id (Integer)
  • executor_corp_id (Integer)
  • member_count (Integer)
  • start_date (Time)

Returns:



11
12
13
14
15
16
17
18
# File 'lib/greeve/eve/alliance_list.rb', line 11

rowset :alliances, xpath: "eveapi/result/rowset[@name='alliances']" do
  attribute :name,             xpath: "@name",           type: :string
  attribute :short_name,       xpath: "@shortName",      type: :string
  attribute :alliance_id,      xpath: "@allianceID",     type: :integer
  attribute :executor_corp_id, xpath: "@executorCorpID", type: :integer
  attribute :member_count,     xpath: "@memberCount",    type: :integer
  attribute :start_date,       xpath: "@startDate",      type: :datetime
end