Class: Greeve::Character::PlanetaryColonies

Inherits:
BaseItem
  • Object
show all
Defined in:
lib/greeve/character/planetary_colonies.rb

Overview

Planetary colonies owned by character.

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(character_id, opts = {}) ⇒ PlanetaryColonies

Returns a new instance of PlanetaryColonies

Parameters:

  • character_id (Integer)

    EVE character ID



26
27
28
29
# File 'lib/greeve/character/planetary_colonies.rb', line 26

def initialize(character_id, opts = {})
  opts[:query_params] = { "characterID" => character_id }
  super(opts)
end

Instance Method Details

#coloniesGreeve::Rowset

Parameters:

  • solar_system_id (Integer)
  • solar_system_name (String)
  • planet_id (Integer)
  • planet_name (String)
  • planet_type_id (Integer)
  • planet_type_name (String)
  • owner_id (Integer)
  • owner_name (String)
  • last_update (Time)
  • upgrade_level (Integer)
  • number_of_pins (Integer)

Returns:



11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/greeve/character/planetary_colonies.rb', line 11

rowset :colonies, xpath: "eveapi/result/rowset[@name='colonies']" do
  attribute :solar_system_id,   xpath: "@solarSystemID",   type: :integer
  attribute :solar_system_name, xpath: "@solarSystemName", type: :string
  attribute :planet_id,         xpath: "@planetID",        type: :integer
  attribute :planet_name,       xpath: "@planetName",      type: :string
  attribute :planet_type_id,    xpath: "@planetTypeID",    type: :integer
  attribute :planet_type_name,  xpath: "@planetTypeName",  type: :string
  attribute :owner_id,          xpath: "@ownerID",         type: :integer
  attribute :owner_name,        xpath: "@ownerName",       type: :string
  attribute :last_update,       xpath: "@lastUpdate",      type: :datetime
  attribute :upgrade_level,     xpath: "@upgradeLevel",    type: :integer
  attribute :number_of_pins,    xpath: "@numberOfPins",    type: :integer
end