Class: Greeve::Corporation::WalletTransactions

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

Overview

Corporation wallet transactions.

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(opts = {}) ⇒ WalletTransactions

Returns a new instance of WalletTransactions

Parameters:

  • opts (Hash) (defaults to: {})

    a customizable set of options

Options Hash (opts):

  • :account_key (Integer)

    account key of the wallet for which transactions will be returned (1000 - 1006)

  • :from_id (Integer)

    upper bound for the ref_id of returned transactions. Normally used to walk the transaction log backwards

  • :row_count (Integer)

    limit on the number of rows to return. Default is 1000, max is 2560



36
37
38
39
40
41
42
43
44
45
46
47
# File 'lib/greeve/corporation/wallet_transactions.rb', line 36

def initialize(opts = {})
   = opts[:account_key]
  from_id = opts[:from_id]
  row_count = opts[:row_count]

  opts[:query_params] = {}
  opts[:query_params]["accountKey"] =  if 
  opts[:query_params]["fromID"] = from_id if from_id
  opts[:query_params]["rowCount"] = row_count if row_count

  super(opts)
end

Instance Method Details

#transactionsGreeve::Rowset

Parameters:

  • transaction_date_time (Time)
  • transaction_id (Integer)
  • quantity (Integer)
  • type_name (String)
  • type_id (Integer)
  • price (BigDecimal)
  • client_id (Integer)
  • client_name (String)
  • character_id (Integer)
  • character_name (String)
  • station_id (Integer)
  • station_name (String)
  • transaction_type (String)
  • transaction_for (String)
  • journal_transaction_id (Integer)
  • client_type_id (Integer)

Returns:



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/greeve/corporation/wallet_transactions.rb', line 11

rowset :transactions, xpath: "eveapi/result/rowset[@name='transactions']" do
  attribute :transaction_date_time,  xpath: "@transactionDateTime",  type: :datetime
  attribute :transaction_id,         xpath: "@transactionID",        type: :integer
  attribute :quantity,               xpath: "@quantity",             type: :integer
  attribute :type_name,              xpath: "@typeName",             type: :string
  attribute :type_id,                xpath: "@typeID",               type: :integer
  attribute :price,                  xpath: "@price",                type: :numeric
  attribute :client_id,              xpath: "@clientID",             type: :integer
  attribute :client_name,            xpath: "@clientName",           type: :string
  attribute :character_id,           xpath: "@characterID",          type: :integer
  attribute :character_name,         xpath: "@characterName",        type: :string
  attribute :station_id,             xpath: "@stationID",            type: :integer
  attribute :station_name,           xpath: "@stationName",          type: :string
  attribute :transaction_type,       xpath: "@transactionType",      type: :string
  attribute :transaction_for,        xpath: "@transactionFor",       type: :string
  attribute :journal_transaction_id, xpath: "@journalTransactionID", type: :integer
  attribute :client_type_id,         xpath: "@clientTypeID",         type: :integer
end