Class: Greeve::Eve::CharacterAffiliation

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

Overview

Corporations, alliances, and factions the character(s) are members of.

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(*ids, opts = {}) ⇒ CharacterAffiliation

Returns a new instance of CharacterAffiliation

Parameters:

  • ids (Array<Integer>)

    IDs of characters



25
26
27
28
29
30
31
# File 'lib/greeve/eve/character_affiliation.rb', line 25

def initialize(*ids)
  opts = ids.last.is_a?(Hash) ? ids.pop : {}

  opts[:query_params] = { "IDs" => ids.join(",") }

  super(opts)
end

Instance Method Details

#charactersGreeve::Rowset

Parameters:

  • character_id (Integer)
  • character_name (String)
  • corporation_id (Integer)
  • corporation_name (String)
  • alliance_id (Integer)
  • alliance_name (String)
  • faction_id (Integer)
  • faction_name (String)

Returns:



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

rowset :characters, xpath: "eveapi/result/rowset[@name='characters']" do
  attribute :character_id,     xpath: "@characterID",     type: :integer
  attribute :character_name,   xpath: "@characterName",   type: :string
  attribute :corporation_id,   xpath: "@corporationID",   type: :integer
  attribute :corporation_name, xpath: "@corporationName", type: :string
  attribute :alliance_id,      xpath: "@allianceID",      type: :integer
  attribute :alliance_name,    xpath: "@allianceName",    type: :string
  attribute :faction_id,       xpath: "@factionID",       type: :integer
  attribute :faction_name,     xpath: "@factionName",     type: :string
end