Class: Greeve::Corporation::WalletJournal

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

Overview

Corporation wallet journal.

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

Returns a new instance of WalletJournal

Parameters:

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

    a customizable set of options

Options Hash (opts):

  • :account_key (Integer)

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

  • :from_id (Integer)

    upper bound for the ref_id of returned journal entries. Normally used to walk the journal backwards

  • :row_count (Integer)

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



34
35
36
37
38
39
40
41
42
43
44
45
# File 'lib/greeve/corporation/wallet_journal.rb', line 34

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

#entriesGreeve::Rowset

Parameters:

  • date (Time)
  • ref_id (Integer)
  • ref_type_id (Integer)
  • owner_name_1 (String)
  • owner_id_1 (Integer)
  • owner_name_2 (String)
  • owner_id_2 (Integer)
  • arg_name_1 (String)
  • arg_id_1 (Integer)
  • amount (BigDecimal)
  • balance (BigDecimal)
  • reason (String)
  • owner_1_type_id (Integer)
  • owner_2_type_id (Integer)

Returns:



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

rowset :entries, xpath: "eveapi/result/rowset[@name='entries']" do
  attribute :date,            xpath: "@date",         type: :datetime
  attribute :ref_id,          xpath: "@refID",        type: :integer
  attribute :ref_type_id,     xpath: "@refTypeID",    type: :integer
  attribute :owner_name_1,    xpath: "@ownerName1",   type: :string
  attribute :owner_id_1,      xpath: "@ownerID1",     type: :integer
  attribute :owner_name_2,    xpath: "@ownerName2",   type: :string
  attribute :owner_id_2,      xpath: "@ownerID2",     type: :integer
  attribute :arg_name_1,      xpath: "@argName1",     type: :string
  attribute :arg_id_1,        xpath: "@argID1",       type: :integer
  attribute :amount,          xpath: "@amount",       type: :numeric
  attribute :balance,         xpath: "@balance",      type: :numeric
  attribute :reason,          xpath: "@reason",       type: :string
  attribute :owner_1_type_id, xpath: "@owner1TypeID", type: :integer
  attribute :owner_2_type_id, xpath: "@owner2TypeID", type: :integer
end