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.



108
109
110
111
112
# File 'lib/eve-api/eve-api.rb', line 108

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



113
114
115
116
117
118
119
# File 'lib/eve-api/eve-api.rb', line 113

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



120
121
122
123
124
125
126
# File 'lib/eve-api/eve-api.rb', line 120

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