Class: Greeve::Eve::CharacterID

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

Overview

Retrieves character IDs based on names.

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

Returns a new instance of CharacterID

Parameters:

  • names (Array<Integer>)

    names of characters



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

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

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

  super(opts)
end

Instance Method Details

#charactersGreeve::Rowset

Parameters:

  • name (String)
  • character_id (Integer)

Returns:



11
12
13
14
# File 'lib/greeve/eve/character_id.rb', line 11

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