Class: EveAPI::Base

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

Instance Method Summary collapse

Constructor Details

#initialize(options, api = nil) ⇒ Base

Returns a new instance of Base.



39
40
41
42
43
# File 'lib/eve-api/eve-api.rb', line 39

def initialize(options, api=nil)
  @api ||= api
  @api ||= Transport::API.new(options)
  @options = options
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method, *args) ⇒ Object



50
51
52
53
# File 'lib/eve-api/eve-api.rb', line 50

def method_missing(method, *args)
  return(@options[method]) if @options.has_key?(method)
  raise(Exceptions::AttributeException,"unknown attribute #{method}")
end

Instance Method Details

#idObject



44
45
46
# File 'lib/eve-api/eve-api.rb', line 44

def id
  return(@options[:id])
end

#typeObject



47
48
49
# File 'lib/eve-api/eve-api.rb', line 47

def type
  return(@options[:type])
end