Class: Greeve::Character::AccountBalance

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

Overview

Character account balance.

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

Returns a new instance of AccountBalance

Parameters:

  • character_id (Integer)

    EVE character ID



18
19
20
21
# File 'lib/greeve/character/account_balance.rb', line 18

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

Instance Method Details

#accountsGreeve::Rowset

Parameters:

  • account_id (Integer)
  • account_key (Integer)
  • balance (BigDecimal)

Returns:



11
12
13
14
15
# File 'lib/greeve/character/account_balance.rb', line 11

rowset :accounts, xpath: "eveapi/result/rowset[@name='accounts']" do
  attribute :account_id,  xpath: "@accountID",  type: :integer
  attribute :account_key, xpath: "@accountKey", type: :integer
  attribute :balance,     xpath: "@balance",    type: :numeric
end