Class: Greeve::Character::ContractItems

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

Overview

Items and details of a particular contract.

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, contract_id, opts = {}) ⇒ ContractItems

Returns a new instance of ContractItems

Parameters:

  • character_id (Integer)

    EVE character ID

  • contract_id (Integer)

    ID of the contract



22
23
24
25
26
27
28
29
# File 'lib/greeve/character/contract_items.rb', line 22

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

  super(opts)
end

Instance Method Details

#item_listGreeve::Rowset

Parameters:

  • record_id (Integer)
  • type_id (Integer)
  • quantity (Integer)
  • raw_quantity (Integer)
  • singleton
  • included

Returns:



11
12
13
14
15
16
17
18
# File 'lib/greeve/character/contract_items.rb', line 11

rowset :item_list, xpath: "eveapi/result/rowset[@name='itemList']" do
  attribute :record_id,    xpath: "@recordID",    type: :integer
  attribute :type_id,      xpath: "@typeID",      type: :integer
  attribute :quantity,     xpath: "@quantity",    type: :integer
  attribute :raw_quantity, xpath: "@rawQuantity", type: :integer
  attribute :singleton,    xpath: "@singleton",   type: :boolean
  attribute :included,     xpath: "@included",    type: :boolean
end