eve_online 0.27.0 → 0.28.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (87) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +11 -0
  3. data/Gemfile.lock +3 -3
  4. data/Gemfile.mutant.lock +2 -2
  5. data/README.md +54 -6
  6. data/lib/eve_online.rb +2 -0
  7. data/lib/eve_online/esi/alliance.rb +3 -3
  8. data/lib/eve_online/esi/alliance_corporations.rb +3 -3
  9. data/lib/eve_online/esi/alliance_icon.rb +3 -3
  10. data/lib/eve_online/esi/alliances.rb +3 -3
  11. data/lib/eve_online/esi/base.rb +27 -4
  12. data/lib/eve_online/esi/character.rb +3 -3
  13. data/lib/eve_online/esi/character_assets.rb +7 -3
  14. data/lib/eve_online/esi/character_assets_locations.rb +3 -3
  15. data/lib/eve_online/esi/character_assets_names.rb +3 -3
  16. data/lib/eve_online/esi/character_attributes.rb +3 -3
  17. data/lib/eve_online/esi/character_blueprints.rb +7 -3
  18. data/lib/eve_online/esi/character_bookmark_folders.rb +7 -3
  19. data/lib/eve_online/esi/character_bookmarks.rb +7 -3
  20. data/lib/eve_online/esi/character_calendar.rb +9 -6
  21. data/lib/eve_online/esi/character_calendar_event.rb +3 -3
  22. data/lib/eve_online/esi/character_clones.rb +3 -3
  23. data/lib/eve_online/esi/character_corporation_history.rb +3 -3
  24. data/lib/eve_online/esi/character_fatigue.rb +3 -3
  25. data/lib/eve_online/esi/character_implants.rb +3 -3
  26. data/lib/eve_online/esi/character_industry_jobs.rb +8 -4
  27. data/lib/eve_online/esi/character_killmails_recent.rb +7 -3
  28. data/lib/eve_online/esi/character_location.rb +3 -3
  29. data/lib/eve_online/esi/character_loyalty_points.rb +3 -3
  30. data/lib/eve_online/esi/character_notifications.rb +3 -3
  31. data/lib/eve_online/esi/character_online.rb +3 -3
  32. data/lib/eve_online/esi/character_orders.rb +3 -3
  33. data/lib/eve_online/esi/character_portrait.rb +3 -3
  34. data/lib/eve_online/esi/character_ship.rb +3 -3
  35. data/lib/eve_online/esi/character_skill_queue.rb +3 -3
  36. data/lib/eve_online/esi/character_skills.rb +3 -3
  37. data/lib/eve_online/esi/character_standings.rb +3 -3
  38. data/lib/eve_online/esi/character_wallet.rb +3 -3
  39. data/lib/eve_online/esi/character_wallet_journal.rb +7 -3
  40. data/lib/eve_online/esi/corporation.rb +3 -3
  41. data/lib/eve_online/esi/corporation_alliance_history.rb +38 -0
  42. data/lib/eve_online/esi/corporation_assets.rb +7 -3
  43. data/lib/eve_online/esi/corporation_assets_locations.rb +3 -3
  44. data/lib/eve_online/esi/corporation_assets_names.rb +3 -3
  45. data/lib/eve_online/esi/corporation_blueprints.rb +7 -3
  46. data/lib/eve_online/esi/corporation_industry_jobs.rb +8 -4
  47. data/lib/eve_online/esi/corporation_killmails_recent.rb +7 -3
  48. data/lib/eve_online/esi/corporation_loyalty_store_offers.rb +3 -3
  49. data/lib/eve_online/esi/corporation_orders.rb +7 -3
  50. data/lib/eve_online/esi/dogma_attribute.rb +3 -3
  51. data/lib/eve_online/esi/dogma_attributes.rb +3 -3
  52. data/lib/eve_online/esi/dogma_effect.rb +3 -3
  53. data/lib/eve_online/esi/dogma_effects.rb +3 -3
  54. data/lib/eve_online/esi/market_history.rb +7 -3
  55. data/lib/eve_online/esi/models/corporation_alliance_history.rb +36 -0
  56. data/lib/eve_online/esi/server_status.rb +3 -3
  57. data/lib/eve_online/esi/universe_ancestries.rb +7 -3
  58. data/lib/eve_online/esi/universe_asteroid_belt.rb +3 -3
  59. data/lib/eve_online/esi/universe_bloodlines.rb +7 -3
  60. data/lib/eve_online/esi/universe_categories.rb +3 -3
  61. data/lib/eve_online/esi/universe_category.rb +7 -3
  62. data/lib/eve_online/esi/universe_constellation.rb +7 -3
  63. data/lib/eve_online/esi/universe_constellations.rb +3 -3
  64. data/lib/eve_online/esi/universe_factions.rb +7 -3
  65. data/lib/eve_online/esi/universe_graphic.rb +3 -3
  66. data/lib/eve_online/esi/universe_graphics.rb +3 -3
  67. data/lib/eve_online/esi/universe_group.rb +7 -3
  68. data/lib/eve_online/esi/universe_groups.rb +7 -3
  69. data/lib/eve_online/esi/universe_moon.rb +3 -3
  70. data/lib/eve_online/esi/universe_planet.rb +3 -3
  71. data/lib/eve_online/esi/universe_races.rb +7 -3
  72. data/lib/eve_online/esi/universe_region.rb +7 -3
  73. data/lib/eve_online/esi/universe_regions.rb +3 -3
  74. data/lib/eve_online/esi/universe_star.rb +3 -3
  75. data/lib/eve_online/esi/universe_stargate.rb +3 -3
  76. data/lib/eve_online/esi/universe_station.rb +3 -3
  77. data/lib/eve_online/esi/universe_structures.rb +15 -3
  78. data/lib/eve_online/esi/universe_system.rb +7 -3
  79. data/lib/eve_online/esi/universe_system_jumps.rb +3 -3
  80. data/lib/eve_online/esi/universe_system_kills.rb +3 -3
  81. data/lib/eve_online/esi/universe_systems.rb +3 -3
  82. data/lib/eve_online/esi/universe_type.rb +7 -3
  83. data/lib/eve_online/esi/universe_types.rb +7 -3
  84. data/lib/eve_online/esi/war_killmails.rb +7 -3
  85. data/lib/eve_online/esi/wars.rb +14 -7
  86. data/lib/eve_online/version.rb +1 -1
  87. metadata +4 -2
@@ -3,7 +3,7 @@
3
3
  module EveOnline
4
4
  module ESI
5
5
  class CharacterWalletJournal < Base
6
- API_PATH = '/v6/characters/%<character_id>s/wallet/journal/?datasource=%<datasource>s&page=%<page>s'
6
+ API_PATH = '/v6/characters/%<character_id>s/wallet/journal/'
7
7
 
8
8
  attr_reader :character_id, :page
9
9
 
@@ -29,8 +29,12 @@ module EveOnline
29
29
  'esi-wallet.read_character_wallet.v1'
30
30
  end
31
31
 
32
- def url
33
- format("#{ API_HOST }#{ API_PATH }", character_id: character_id, datasource: datasource, page: page)
32
+ def additation_query_params
33
+ [:page]
34
+ end
35
+
36
+ def path
37
+ format("#{ API_PATH }", character_id: character_id)
34
38
  end
35
39
  end
36
40
  end
@@ -7,7 +7,7 @@ module EveOnline
7
7
  class Corporation < Base
8
8
  extend Forwardable
9
9
 
10
- API_PATH = '/v4/corporations/%<corporation_id>s/?datasource=%<datasource>s'
10
+ API_PATH = '/v4/corporations/%<corporation_id>s/'
11
11
 
12
12
  attr_reader :corporation_id
13
13
 
@@ -28,8 +28,8 @@ module EveOnline
28
28
 
29
29
  def scope; end
30
30
 
31
- def url
32
- format("#{ API_HOST }#{ API_PATH }", corporation_id: corporation_id, datasource: datasource)
31
+ def path
32
+ format("#{ API_PATH }", corporation_id: corporation_id)
33
33
  end
34
34
  end
35
35
  end
@@ -0,0 +1,38 @@
1
+ # frozen_string_literal: true
2
+
3
+ module EveOnline
4
+ module ESI
5
+ class CorporationAllianceHistory < Base
6
+ API_PATH = '/v2/corporations/%<corporation_id>s/alliancehistory/'
7
+
8
+ attr_reader :corporation_id
9
+
10
+ def initialize(options)
11
+ super
12
+
13
+ @corporation_id = options.fetch(:corporation_id)
14
+ end
15
+
16
+ def entries
17
+ @entries ||=
18
+ begin
19
+ output = []
20
+ response.each do |record|
21
+ output << Models::CorporationAllianceHistory.new(record)
22
+ end
23
+ output
24
+ end
25
+ end
26
+
27
+ def scope; end
28
+
29
+ def roles
30
+ []
31
+ end
32
+
33
+ def path
34
+ format("#{ API_PATH }", corporation_id: corporation_id)
35
+ end
36
+ end
37
+ end
38
+ end
@@ -3,7 +3,7 @@
3
3
  module EveOnline
4
4
  module ESI
5
5
  class CorporationAssets < Base
6
- API_PATH = '/v3/corporations/%<corporation_id>s/assets/?datasource=%<datasource>s&page=%<page>s'
6
+ API_PATH = '/v3/corporations/%<corporation_id>s/assets/'
7
7
 
8
8
  attr_reader :corporation_id, :page
9
9
 
@@ -33,8 +33,12 @@ module EveOnline
33
33
  ['Director']
34
34
  end
35
35
 
36
- def url
37
- format("#{ API_HOST }#{ API_PATH }", corporation_id: corporation_id, datasource: datasource, page: page)
36
+ def additation_query_params
37
+ [:page]
38
+ end
39
+
40
+ def path
41
+ format("#{ API_PATH }", corporation_id: corporation_id)
38
42
  end
39
43
  end
40
44
  end
@@ -3,7 +3,7 @@
3
3
  module EveOnline
4
4
  module ESI
5
5
  class CorporationAssetsLocations < Base
6
- API_PATH = '/v2/corporations/%<corporation_id>s/assets/locations/?datasource=%<datasource>s'
6
+ API_PATH = '/v2/corporations/%<corporation_id>s/assets/locations/'
7
7
 
8
8
  attr_reader :corporation_id, :item_ids
9
9
 
@@ -45,8 +45,8 @@ module EveOnline
45
45
  raise NotImplementedError
46
46
  end
47
47
 
48
- def url
49
- format("#{ API_HOST }#{ API_PATH }", corporation_id: corporation_id, datasource: datasource)
48
+ def path
49
+ format("#{ API_PATH }", corporation_id: corporation_id)
50
50
  end
51
51
  end
52
52
  end
@@ -3,7 +3,7 @@
3
3
  module EveOnline
4
4
  module ESI
5
5
  class CorporationAssetsNames < Base
6
- API_PATH = '/v1/corporations/%<corporation_id>s/assets/names/?datasource=%<datasource>s'
6
+ API_PATH = '/v1/corporations/%<corporation_id>s/assets/names/'
7
7
 
8
8
  attr_reader :corporation_id, :item_ids
9
9
 
@@ -45,8 +45,8 @@ module EveOnline
45
45
  raise NotImplementedError
46
46
  end
47
47
 
48
- def url
49
- format("#{ API_HOST }#{ API_PATH }", corporation_id: corporation_id, datasource: datasource)
48
+ def path
49
+ format("#{ API_PATH }", corporation_id: corporation_id)
50
50
  end
51
51
  end
52
52
  end
@@ -3,7 +3,7 @@
3
3
  module EveOnline
4
4
  module ESI
5
5
  class CorporationBlueprints < Base
6
- API_PATH = '/v2/corporations/%<corporation_id>s/blueprints/?datasource=%<datasource>s&page=%<page>s'
6
+ API_PATH = '/v2/corporations/%<corporation_id>s/blueprints/'
7
7
 
8
8
  attr_reader :corporation_id, :page
9
9
 
@@ -33,8 +33,12 @@ module EveOnline
33
33
  ['Director']
34
34
  end
35
35
 
36
- def url
37
- format("#{ API_HOST }#{ API_PATH }", corporation_id: corporation_id, datasource: datasource, page: page)
36
+ def additation_query_params
37
+ [:page]
38
+ end
39
+
40
+ def path
41
+ format("#{ API_PATH }", corporation_id: corporation_id)
38
42
  end
39
43
  end
40
44
  end
@@ -3,7 +3,7 @@
3
3
  module EveOnline
4
4
  module ESI
5
5
  class CorporationIndustryJobs < Base
6
- API_PATH = '/v1/corporations/%<corporation_id>s/industry/jobs/?datasource=%<datasource>s&include_completed=%<include_completed>s&page=%<page>s'
6
+ API_PATH = '/v1/corporations/%<corporation_id>s/industry/jobs/'
7
7
 
8
8
  attr_reader :corporation_id, :include_completed, :page
9
9
 
@@ -11,7 +11,7 @@ module EveOnline
11
11
  super
12
12
 
13
13
  @corporation_id = options.fetch(:corporation_id)
14
- @include_completed = options.fetch(:include_completed, false)
14
+ @include_completed = options.fetch(:include_completed, nil)
15
15
  @page = options.fetch(:page, 1)
16
16
  end
17
17
 
@@ -34,8 +34,12 @@ module EveOnline
34
34
  ['Factory_Manager']
35
35
  end
36
36
 
37
- def url
38
- format("#{ API_HOST }#{ API_PATH }", corporation_id: corporation_id, include_completed: include_completed, datasource: datasource, page: page)
37
+ def additation_query_params
38
+ [:include_completed, :page]
39
+ end
40
+
41
+ def path
42
+ format("#{ API_PATH }", corporation_id: corporation_id)
39
43
  end
40
44
  end
41
45
  end
@@ -3,7 +3,7 @@
3
3
  module EveOnline
4
4
  module ESI
5
5
  class CorporationKillmailsRecent < Base
6
- API_PATH = '/v1/corporations/%<corporation_id>s/killmails/recent/?datasource=%<datasource>s&page=%<page>s'
6
+ API_PATH = '/v1/corporations/%<corporation_id>s/killmails/recent/'
7
7
 
8
8
  attr_reader :corporation_id, :page
9
9
 
@@ -33,8 +33,12 @@ module EveOnline
33
33
  ['Director']
34
34
  end
35
35
 
36
- def url
37
- format("#{ API_HOST }#{ API_PATH }", corporation_id: corporation_id, datasource: datasource, page: page)
36
+ def additation_query_params
37
+ [:page]
38
+ end
39
+
40
+ def path
41
+ format("#{ API_PATH }", corporation_id: corporation_id)
38
42
  end
39
43
  end
40
44
  end
@@ -3,7 +3,7 @@
3
3
  module EveOnline
4
4
  module ESI
5
5
  class CorporationLoyaltyStoreOffers < Base
6
- API_PATH = '/v1/loyalty/stores/%<corporation_id>s/offers/?datasource=%<datasource>s'
6
+ API_PATH = '/v1/loyalty/stores/%<corporation_id>s/offers/'
7
7
 
8
8
  attr_reader :corporation_id
9
9
 
@@ -30,8 +30,8 @@ module EveOnline
30
30
  []
31
31
  end
32
32
 
33
- def url
34
- format("#{ API_HOST }#{ API_PATH }", corporation_id: corporation_id, datasource: datasource)
33
+ def path
34
+ format("#{ API_PATH }", corporation_id: corporation_id)
35
35
  end
36
36
  end
37
37
  end
@@ -3,7 +3,7 @@
3
3
  module EveOnline
4
4
  module ESI
5
5
  class CorporationOrders < Base
6
- API_PATH = '/v3/corporations/%<corporation_id>s/orders/?datasource=%<datasource>s&page=%<page>s'
6
+ API_PATH = '/v3/corporations/%<corporation_id>s/orders/'
7
7
 
8
8
  attr_reader :corporation_id, :page
9
9
 
@@ -33,8 +33,12 @@ module EveOnline
33
33
  ['Accountant', 'Trader']
34
34
  end
35
35
 
36
- def url
37
- format("#{ API_HOST }#{ API_PATH }", corporation_id: corporation_id, datasource: datasource, page: page)
36
+ def additation_query_params
37
+ [:page]
38
+ end
39
+
40
+ def path
41
+ format("#{ API_PATH }", corporation_id: corporation_id)
38
42
  end
39
43
  end
40
44
  end
@@ -7,7 +7,7 @@ module EveOnline
7
7
  class DogmaAttribute < Base
8
8
  extend Forwardable
9
9
 
10
- API_PATH = '/v1/dogma/attributes/%<attribute_id>s/?datasource=%<datasource>s'
10
+ API_PATH = '/v1/dogma/attributes/%<attribute_id>s/'
11
11
 
12
12
  attr_reader :id
13
13
 
@@ -27,8 +27,8 @@ module EveOnline
27
27
 
28
28
  def scope; end
29
29
 
30
- def url
31
- format("#{ API_HOST }#{ API_PATH }", attribute_id: id, datasource: datasource)
30
+ def path
31
+ format("#{ API_PATH }", attribute_id: id)
32
32
  end
33
33
  end
34
34
  end
@@ -3,7 +3,7 @@
3
3
  module EveOnline
4
4
  module ESI
5
5
  class DogmaAttributes < Base
6
- API_PATH = '/v1/dogma/attributes/?datasource=%<datasource>s'
6
+ API_PATH = '/v1/dogma/attributes/'
7
7
 
8
8
  def attribute_ids
9
9
  response
@@ -11,8 +11,8 @@ module EveOnline
11
11
 
12
12
  def scope; end
13
13
 
14
- def url
15
- format("#{ API_HOST }#{ API_PATH }", datasource: datasource)
14
+ def path
15
+ API_PATH
16
16
  end
17
17
  end
18
18
  end
@@ -7,7 +7,7 @@ module EveOnline
7
7
  class DogmaEffect < Base
8
8
  extend Forwardable
9
9
 
10
- API_PATH = '/v2/dogma/effects/%<effect_id>s/?datasource=%<datasource>s'
10
+ API_PATH = '/v2/dogma/effects/%<effect_id>s/'
11
11
 
12
12
  attr_reader :id
13
13
 
@@ -32,8 +32,8 @@ module EveOnline
32
32
 
33
33
  def scope; end
34
34
 
35
- def url
36
- format("#{ API_HOST }#{ API_PATH }", effect_id: id, datasource: datasource)
35
+ def path
36
+ format("#{ API_PATH }", effect_id: id)
37
37
  end
38
38
  end
39
39
  end
@@ -3,7 +3,7 @@
3
3
  module EveOnline
4
4
  module ESI
5
5
  class DogmaEffects < Base
6
- API_PATH = '/v1/dogma/effects/?datasource=%<datasource>s'
6
+ API_PATH = '/v1/dogma/effects/'
7
7
 
8
8
  def effect_ids
9
9
  response
@@ -11,8 +11,8 @@ module EveOnline
11
11
 
12
12
  def scope; end
13
13
 
14
- def url
15
- format("#{ API_HOST }#{ API_PATH }", datasource: datasource)
14
+ def path
15
+ API_PATH
16
16
  end
17
17
  end
18
18
  end
@@ -3,7 +3,7 @@
3
3
  module EveOnline
4
4
  module ESI
5
5
  class MarketHistory < Base
6
- API_PATH = '/v1/markets/%<region_id>s/history/?datasource=%<datasource>s&type_id=%<type_id>s'
6
+ API_PATH = '/v1/markets/%<region_id>s/history/'
7
7
 
8
8
  attr_reader :region_id, :type_id
9
9
 
@@ -27,8 +27,12 @@ module EveOnline
27
27
 
28
28
  def scope; end
29
29
 
30
- def url
31
- format("#{ API_HOST }#{ API_PATH }", region_id: region_id, type_id: type_id, datasource: datasource)
30
+ def additation_query_params
31
+ [:type_id]
32
+ end
33
+
34
+ def path
35
+ format("#{ API_PATH }", region_id: region_id)
32
36
  end
33
37
  end
34
38
  end
@@ -0,0 +1,36 @@
1
+ # frozen_string_literal: true
2
+
3
+ module EveOnline
4
+ module ESI
5
+ module Models
6
+ class CorporationAllianceHistory < Base
7
+ def as_json
8
+ {
9
+ alliance_id: alliance_id,
10
+ is_deleted: is_deleted,
11
+ record_id: record_id,
12
+ start_date: start_date
13
+ }
14
+ end
15
+
16
+ def alliance_id
17
+ options['alliance_id']
18
+ end
19
+
20
+ def is_deleted
21
+ options['is_deleted']
22
+ end
23
+
24
+ def record_id
25
+ options['record_id']
26
+ end
27
+
28
+ def start_date
29
+ start_date = options['start_date']
30
+
31
+ parse_datetime_with_timezone(start_date) if start_date
32
+ end
33
+ end
34
+ end
35
+ end
36
+ end
@@ -7,7 +7,7 @@ module EveOnline
7
7
  class ServerStatus < Base
8
8
  extend Forwardable
9
9
 
10
- API_PATH = '/v1/status/?datasource=%<datasource>s'
10
+ API_PATH = '/v1/status/'
11
11
 
12
12
  def_delegators :model, :as_json, :players, :server_version, :start_time, :vip
13
13
 
@@ -17,8 +17,8 @@ module EveOnline
17
17
 
18
18
  def scope; end
19
19
 
20
- def url
21
- format("#{ API_HOST }#{ API_PATH }", datasource: datasource)
20
+ def path
21
+ API_PATH
22
22
  end
23
23
  end
24
24
  end
@@ -3,7 +3,7 @@
3
3
  module EveOnline
4
4
  module ESI
5
5
  class UniverseAncestries < Base
6
- API_PATH = '/v1/universe/ancestries/?datasource=%<datasource>s'
6
+ API_PATH = '/v1/universe/ancestries/'
7
7
 
8
8
  def ancestries
9
9
  @ancestries ||=
@@ -18,8 +18,12 @@ module EveOnline
18
18
 
19
19
  def scope; end
20
20
 
21
- def url
22
- format("#{ API_HOST }#{ API_PATH }", datasource: datasource)
21
+ def additation_query_params
22
+ [:language]
23
+ end
24
+
25
+ def path
26
+ API_PATH
23
27
  end
24
28
  end
25
29
  end