Class: EveAPI::Account

Inherits:
Base
  • Object
show all
Defined in:
lib/eve-api/eve-api.rb

Instance Method Summary collapse

Methods inherited from Base

#id, #method_missing, #type

Constructor Details

#initialize(options, api, character, type) ⇒ Account

Returns a new instance of Account.



141
142
143
144
145
# File 'lib/eve-api/eve-api.rb', line 141

def initialize(options, api, character, type)
  super(options, api)
  options[:character] = character
  options[:type] = type
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class EveAPI::Base

Instance Method Details

#journalObject



146
147
148
149
150
151
152
# File 'lib/eve-api/eve-api.rb', line 146

def journal
  journal = []
  @api.(character.id, type, key).each do |raw_journal_entry|
    journal << JournalEntry.new(raw_journal_entry, @api)
  end
  return journal
end

#transactionsObject



153
154
155
156
157
158
159
# File 'lib/eve-api/eve-api.rb', line 153

def transactions
  transactions = []
  @api.(character.id, type, key).each do |raw_transaction|
    transactions << Transaction.new(raw_transaction, @api)
  end
  return transactions
end