Class: EveAPI::User

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

Instance Method Summary collapse

Methods included from Common

#extract_options_from_args!

Methods inherited from Base

#id, #method_missing, #type

Constructor Details

#initialize(*args) ⇒ User

Returns a new instance of User.



58
59
60
61
62
# File 'lib/eve-api/eve-api.rb', line 58

def initialize(*args)
  super(extract_options_from_args!(args))
  raise(Exceptions::InputException, "id required") unless @options[:id]
  raise(Exceptions::InputException, "api_key required") unless @options[:api_key]
end

Dynamic Method Handling

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

Instance Method Details

#charactersObject



63
64
65
66
67
68
69
# File 'lib/eve-api/eve-api.rb', line 63

def characters
  characters = []
  @api.characters.each do |raw_character_id, raw_character|
    characters << Character.new(raw_character, @api)
  end
  return characters
end