Class: EveAPI::Base
- Inherits:
-
Object
- Object
- EveAPI::Base
- Defined in:
- lib/eve-api/eve-api.rb
Direct Known Subclasses
Account, Character, Corporation, JournalEntry, Member, Transaction, User
Instance Method Summary collapse
- #id ⇒ Object
-
#initialize(options, api = nil) ⇒ Base
constructor
A new instance of Base.
- #method_missing(method, *args) ⇒ Object
- #type ⇒ Object
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(, api=nil) @api ||= api @api ||= Transport::API.new() @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
#id ⇒ Object
44 45 46 |
# File 'lib/eve-api/eve-api.rb', line 44 def id return(@options[:id]) end |
#type ⇒ Object
47 48 49 |
# File 'lib/eve-api/eve-api.rb', line 47 def type return(@options[:type]) end |