Class: Greeve::Eve::TypeName

Inherits:
BaseItem show all
Defined in:
lib/greeve/eve/type_name.rb

Overview

Returns the names associated with a sequence of typeIDs.

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

Returns a new instance of TypeName

Parameters:

  • ids (Array<Integer>, Integer)

    EVE type IDs



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

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

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

  super(opts)
end

Instance Method Details

#typesGreeve::Rowset

Parameters:

  • type_id (Integer)
  • type_name (String)

Returns:



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

rowset :types, xpath: "eveapi/result/rowset[@name='types']" do
  attribute :type_id,   xpath: "@typeID",   type: :integer
  attribute :type_name, xpath: "@typeName", type: :string
end