Class: EVEApi::Crest

Inherits:
Object
  • Object
show all
Defined in:
lib/eveapi/crest.rb

Overview

CREST API handling

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeCrest

Returns a new instance of Crest.



5
6
7
# File 'lib/eveapi/crest.rb', line 5

def initialize
  @connection ||= Excon.new(CREST_ENDPOINT)
end

Instance Attribute Details

#connectionObject

Returns the value of attribute connection.



4
5
6
# File 'lib/eveapi/crest.rb', line 4

def connection
  @connection
end

Instance Method Details

#alliancesArray

List of Alliances

Returns:

See Also:



23
24
25
26
27
28
# File 'lib/eveapi/crest.rb', line 23

def alliances
  alliances = paginate(__method__.to_s + '/')
  alliances.map do |alliance|
    EVEApi::Alliance.new alliance[:href]
  end
end

#typesArray

List of Types

Returns:

  • (Array)

    List of types with descriptions and ID’s



33
34
35
36
37
38
# File 'lib/eveapi/crest.rb', line 33

def types
  types = paginate(__method__.to_s + '/')
  types.map do |type|
    type.merge!(type_id: type[:href].match(%r{(\d*)\/$})[1])
  end
end