Class: Greeve::Corporation::Locations

Inherits:
BaseItem
  • Object
show all
Defined in:
lib/greeve/corporation/locations.rb

Overview

Location of an item or 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(*ids, opts = {}) ⇒ Locations

Returns a new instance of Locations

Parameters:

  • ids (Array<Integer>)

    IDs of items to retrieve location info for



22
23
24
25
26
27
28
# File 'lib/greeve/corporation/locations.rb', line 22

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

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

  super(opts)
end

Instance Method Details

#locationsGreeve::Rowset

Parameters:

  • item_id (Integer)
  • item_name (String)
  • x (Integer)
  • y (Integer)
  • z (Integer)

Returns:



11
12
13
14
15
16
17
# File 'lib/greeve/corporation/locations.rb', line 11

rowset :locations, xpath: "eveapi/result/rowset[@name='locations']" do
  attribute :item_id,   xpath: "@itemID",   type: :integer
  attribute :item_name, xpath: "@itemName", type: :string
  attribute :x,         xpath: "@x",        type: :integer
  attribute :y,         xpath: "@y",        type: :integer
  attribute :z,         xpath: "@z",        type: :integer
end