Class: Evedb::Model

Inherits:
Object
  • Object
show all
Defined in:
lib/evedb/model.rb

Direct Known Subclasses

Category, Group, Type

Class Method Summary collapse

Class Method Details

.allObject



15
16
17
18
19
# File 'lib/evedb/model.rb', line 15

def self.all
  list.map do |id|
    self::API.new.send self::GET_METHOD, id
  end
end

.find(id) ⇒ Object



5
6
7
8
9
# File 'lib/evedb/model.rb', line 5

def self.find(id)
  self::API.new.send(self::GET_METHOD, id)
rescue ESI::ApiError => e
  return false if e.message == 'Not Found'
end

.listObject



11
12
13
# File 'lib/evedb/model.rb', line 11

def self.list
  self::API.new.send(self::LIST_METHOD)
end