Class: Greeve::Eve::CharacterName

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

Overview

Returns the names for a comma-separated list of owner IDs for characters, corporations, alliances, etc.

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 = {}) ⇒ CharacterName

Returns a new instance of CharacterName

Parameters:

  • ids (Array<Integer>)

    IDs of characters



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

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:

  • name (String)
  • character_id (Integer)

Returns:



12
13
14
15
# File 'lib/greeve/eve/character_name.rb', line 12

rowset :characters, xpath: "eveapi/result/rowset[@name='characters']" do
  attribute :name,         xpath: "@name",        type: :string
  attribute :character_id, xpath: "@characterID", type: :integer
end