Class: EVEApi::Crest
- Inherits:
-
Object
- Object
- EVEApi::Crest
- Defined in:
- lib/eveapi/crest.rb
Overview
CREST API handling
Instance Attribute Summary collapse
-
#connection ⇒ Object
Returns the value of attribute connection.
Instance Method Summary collapse
-
#alliances ⇒ Array
List of Alliances.
-
#initialize ⇒ Crest
constructor
A new instance of Crest.
-
#types ⇒ Array
List of Types.
Constructor Details
#initialize ⇒ Crest
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
#connection ⇒ Object
Returns the value of attribute connection.
4 5 6 |
# File 'lib/eveapi/crest.rb', line 4 def connection @connection end |
Instance Method Details
#alliances ⇒ Array
List of Alliances
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 |
#types ⇒ Array
List of Types
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 |