eve_online 0.18.0 → 0.19.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (54) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +36 -1
  3. data/Gemfile.lock +3 -7
  4. data/Gemfile.mutant.lock +20 -24
  5. data/README.md +208 -52
  6. data/TODO.md +2 -2
  7. data/eve_online.gemspec +1 -2
  8. data/lib/eve_online.rb +62 -35
  9. data/lib/eve_online/esi/alliance_corporations.rb +1 -1
  10. data/lib/eve_online/esi/alliances.rb +1 -1
  11. data/lib/eve_online/esi/ancestries.rb +1 -1
  12. data/lib/eve_online/esi/base.rb +72 -36
  13. data/lib/eve_online/esi/bloodlines.rb +1 -1
  14. data/lib/eve_online/esi/character_assets.rb +0 -4
  15. data/lib/eve_online/esi/character_assets_locations.rb +43 -0
  16. data/lib/eve_online/esi/character_assets_names.rb +43 -0
  17. data/lib/eve_online/esi/character_blueprints.rb +0 -4
  18. data/lib/eve_online/esi/character_bookmark_folders.rb +0 -4
  19. data/lib/eve_online/esi/character_bookmarks.rb +0 -4
  20. data/lib/eve_online/esi/character_implants.rb +1 -1
  21. data/lib/eve_online/esi/character_killmails_recent.rb +0 -4
  22. data/lib/eve_online/esi/character_wallet_journal.rb +0 -4
  23. data/lib/eve_online/esi/corporation_blueprints.rb +0 -4
  24. data/lib/eve_online/esi/corporation_industry_jobs.rb +0 -4
  25. data/lib/eve_online/esi/corporation_killmails_recent.rb +0 -4
  26. data/lib/eve_online/esi/corporation_orders.rb +0 -4
  27. data/lib/eve_online/esi/dogma_attributes.rb +1 -1
  28. data/lib/eve_online/esi/dogma_effect.rb +41 -0
  29. data/lib/eve_online/esi/dogma_effects.rb +19 -0
  30. data/lib/eve_online/esi/factions.rb +1 -1
  31. data/lib/eve_online/esi/models/asset_location.rb +23 -0
  32. data/lib/eve_online/esi/models/asset_name.rb +24 -0
  33. data/lib/eve_online/esi/models/constellation.rb +4 -15
  34. data/lib/eve_online/esi/models/dogma_attribute_short.rb +24 -0
  35. data/lib/eve_online/esi/models/dogma_attributes.rb +21 -0
  36. data/lib/eve_online/esi/models/dogma_effect.rb +118 -0
  37. data/lib/eve_online/esi/models/dogma_effect_modifier.rb +44 -0
  38. data/lib/eve_online/esi/models/dogma_effect_modifiers.rb +21 -0
  39. data/lib/eve_online/esi/models/dogma_effect_short.rb +24 -0
  40. data/lib/eve_online/esi/models/dogma_effects.rb +21 -0
  41. data/lib/eve_online/esi/models/position.rb +29 -0
  42. data/lib/eve_online/esi/models/type.rb +8 -2
  43. data/lib/eve_online/esi/races.rb +1 -1
  44. data/lib/eve_online/esi/universe_constellation.rb +3 -3
  45. data/lib/eve_online/esi/universe_constellations.rb +1 -1
  46. data/lib/eve_online/esi/universe_region.rb +1 -1
  47. data/lib/eve_online/esi/universe_regions.rb +1 -1
  48. data/lib/eve_online/esi/universe_systems.rb +1 -1
  49. data/lib/eve_online/esi/universe_type.rb +2 -2
  50. data/lib/eve_online/esi/universe_types.rb +1 -5
  51. data/lib/eve_online/esi/war_killmails.rb +0 -4
  52. data/lib/eve_online/esi/wars.rb +1 -1
  53. data/lib/eve_online/version.rb +1 -1
  54. metadata +17 -17
@@ -23,10 +23,6 @@ module EveOnline
23
23
  end
24
24
  memoize :blueprints
25
25
 
26
- def total_pages
27
- resource.headers['x-pages']&.to_i
28
- end
29
-
30
26
  def scope
31
27
  'esi-characters.read_blueprints.v1'
32
28
  end
@@ -23,10 +23,6 @@ module EveOnline
23
23
  end
24
24
  memoize :bookmark_folders
25
25
 
26
- def total_pages
27
- resource.headers['x-pages']&.to_i
28
- end
29
-
30
26
  def scope
31
27
  'esi-bookmarks.read_character_bookmarks.v1'
32
28
  end
@@ -23,10 +23,6 @@ module EveOnline
23
23
  end
24
24
  memoize :bookmarks
25
25
 
26
- def total_pages
27
- resource.headers['x-pages']&.to_i
28
- end
29
-
30
26
  def scope
31
27
  'esi-bookmarks.read_character_bookmarks.v1'
32
28
  end
@@ -13,7 +13,7 @@ module EveOnline
13
13
  @character_id = options.fetch(:character_id)
14
14
  end
15
15
 
16
- def implants
16
+ def implant_ids
17
17
  response
18
18
  end
19
19
 
@@ -23,10 +23,6 @@ module EveOnline
23
23
  end
24
24
  memoize :killmails
25
25
 
26
- def total_pages
27
- resource.headers['x-pages']&.to_i
28
- end
29
-
30
26
  def scope
31
27
  'esi-killmails.read_killmails.v1'
32
28
  end
@@ -23,10 +23,6 @@ module EveOnline
23
23
  end
24
24
  memoize :wallet_journal_entries
25
25
 
26
- def total_pages
27
- resource.headers['x-pages']&.to_i
28
- end
29
-
30
26
  def scope
31
27
  'esi-wallet.read_character_wallet.v1'
32
28
  end
@@ -23,10 +23,6 @@ module EveOnline
23
23
  end
24
24
  memoize :blueprints
25
25
 
26
- def total_pages
27
- resource.headers['x-pages']&.to_i
28
- end
29
-
30
26
  def scope
31
27
  'esi-corporations.read_blueprints.v1'
32
28
  end
@@ -24,10 +24,6 @@ module EveOnline
24
24
  end
25
25
  memoize :jobs
26
26
 
27
- def total_pages
28
- resource.headers['x-pages']&.to_i
29
- end
30
-
31
27
  def scope
32
28
  'esi-industry.read_corporation_jobs.v1'
33
29
  end
@@ -23,10 +23,6 @@ module EveOnline
23
23
  end
24
24
  memoize :killmails
25
25
 
26
- def total_pages
27
- resource.headers['x-pages']&.to_i
28
- end
29
-
30
26
  def scope
31
27
  'esi-killmails.read_corporation_killmails.v1'
32
28
  end
@@ -23,10 +23,6 @@ module EveOnline
23
23
  end
24
24
  memoize :orders
25
25
 
26
- def total_pages
27
- resource.headers['x-pages']&.to_i
28
- end
29
-
30
26
  def scope
31
27
  'esi-markets.read_corporation_orders.v1'
32
28
  end
@@ -5,7 +5,7 @@ module EveOnline
5
5
  class DogmaAttributes < Base
6
6
  API_ENDPOINT = 'https://esi.evetech.net/v1/dogma/attributes/?datasource=%<datasource>s'
7
7
 
8
- def attributes
8
+ def attribute_ids
9
9
  response
10
10
  end
11
11
 
@@ -0,0 +1,41 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'forwardable'
4
+
5
+ module EveOnline
6
+ module ESI
7
+ class DogmaEffect < Base
8
+ extend Forwardable
9
+
10
+ API_ENDPOINT = 'https://esi.evetech.net/v2/dogma/effects/%<effect_id>s/?datasource=%<datasource>s'
11
+
12
+ attr_reader :id
13
+
14
+ def initialize(options)
15
+ super
16
+
17
+ @id = options.fetch(:id)
18
+ end
19
+
20
+ def_delegators :model, :as_json, :description, :disallow_auto_repeat,
21
+ :discharge_attribute_id, :display_name,
22
+ :duration_attribute_id, :effect_category, :effect_id,
23
+ :electronic_chance, :falloff_attribute_id, :icon_id,
24
+ :is_assistance, :is_offensive, :is_warp_safe,
25
+ :name, :post_expression, :pre_expression, :published,
26
+ :range_attribute_id, :range_chance,
27
+ :tracking_speed_attribute_id, :modifiers
28
+
29
+ def model
30
+ Models::DogmaEffect.new(response)
31
+ end
32
+ memoize :model
33
+
34
+ def scope; end
35
+
36
+ def url
37
+ format(API_ENDPOINT, effect_id: id, datasource: datasource)
38
+ end
39
+ end
40
+ end
41
+ end
@@ -0,0 +1,19 @@
1
+ # frozen_string_literal: true
2
+
3
+ module EveOnline
4
+ module ESI
5
+ class DogmaEffects < Base
6
+ API_ENDPOINT = 'https://esi.evetech.net/v1/dogma/effects/?datasource=%<datasource>s'
7
+
8
+ def effect_ids
9
+ response
10
+ end
11
+
12
+ def scope; end
13
+
14
+ def url
15
+ format(API_ENDPOINT, datasource: datasource)
16
+ end
17
+ end
18
+ end
19
+ end
@@ -3,7 +3,7 @@
3
3
  module EveOnline
4
4
  module ESI
5
5
  class Factions < Base
6
- API_ENDPOINT = 'https://esi.evetech.net/v2/universe/factions/?datasource=%<datasource>s&language=en-us'
6
+ API_ENDPOINT = 'https://esi.evetech.net/v2/universe/factions/?datasource=%<datasource>s'
7
7
 
8
8
  def factions
9
9
  output = []
@@ -0,0 +1,23 @@
1
+ # frozen_string_literal: true
2
+
3
+ module EveOnline
4
+ module ESI
5
+ module Models
6
+ class AssetLocation < Base
7
+ def as_json
8
+ {
9
+ item_id: item_id
10
+ }
11
+ end
12
+
13
+ def item_id
14
+ options['item_id']
15
+ end
16
+
17
+ def position
18
+ @position ||= Position.new(options['position'])
19
+ end
20
+ end
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,24 @@
1
+ # frozen_string_literal: true
2
+
3
+ module EveOnline
4
+ module ESI
5
+ module Models
6
+ class AssetName < Base
7
+ def as_json
8
+ {
9
+ item_id: item_id,
10
+ name: name
11
+ }
12
+ end
13
+
14
+ def item_id
15
+ options['item_id']
16
+ end
17
+
18
+ def name
19
+ options['name']
20
+ end
21
+ end
22
+ end
23
+ end
24
+ end
@@ -8,9 +8,6 @@ module EveOnline
8
8
  {
9
9
  constellation_id: constellation_id,
10
10
  name: name,
11
- position_x: position_x,
12
- position_y: position_y,
13
- position_z: position_z,
14
11
  region_id: region_id,
15
12
  systems: systems
16
13
  }
@@ -24,18 +21,6 @@ module EveOnline
24
21
  options['name']
25
22
  end
26
23
 
27
- def position_x
28
- options['position']['x'] if options['position']
29
- end
30
-
31
- def position_y
32
- options['position']['y'] if options['position']
33
- end
34
-
35
- def position_z
36
- options['position']['z'] if options['position']
37
- end
38
-
39
24
  def region_id
40
25
  options['region_id']
41
26
  end
@@ -43,6 +28,10 @@ module EveOnline
43
28
  def systems
44
29
  options['systems']
45
30
  end
31
+
32
+ def position
33
+ @position ||= Position.new(options['position'])
34
+ end
46
35
  end
47
36
  end
48
37
  end
@@ -0,0 +1,24 @@
1
+ # frozen_string_literal: true
2
+
3
+ module EveOnline
4
+ module ESI
5
+ module Models
6
+ class DogmaAttributeShort < Base
7
+ def as_json
8
+ {
9
+ attribute_id: attribute_id,
10
+ value: value
11
+ }
12
+ end
13
+
14
+ def attribute_id
15
+ options['attribute_id']
16
+ end
17
+
18
+ def value
19
+ options['value']
20
+ end
21
+ end
22
+ end
23
+ end
24
+ end
@@ -0,0 +1,21 @@
1
+ # frozen_string_literal: true
2
+
3
+ module EveOnline
4
+ module ESI
5
+ module Models
6
+ class DogmaAttributes < Base
7
+ def dogma_attributes
8
+ output = []
9
+
10
+ return output if !options.is_a?(Array)
11
+
12
+ options.each do |dogma_attribute_short|
13
+ output << DogmaAttributeShort.new(dogma_attribute_short)
14
+ end
15
+
16
+ output
17
+ end
18
+ end
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,118 @@
1
+ # frozen_string_literal: true
2
+
3
+ module EveOnline
4
+ module ESI
5
+ module Models
6
+ class DogmaEffect < Base
7
+ def as_json
8
+ {
9
+ description: description,
10
+ disallow_auto_repeat: disallow_auto_repeat,
11
+ discharge_attribute_id: discharge_attribute_id,
12
+ display_name: display_name,
13
+ duration_attribute_id: duration_attribute_id,
14
+ effect_category: effect_category,
15
+ effect_id: effect_id,
16
+ electronic_chance: electronic_chance,
17
+ falloff_attribute_id: falloff_attribute_id,
18
+ icon_id: icon_id,
19
+ is_assistance: is_assistance,
20
+ is_offensive: is_offensive,
21
+ is_warp_safe: is_warp_safe,
22
+ name: name,
23
+ post_expression: post_expression,
24
+ pre_expression: pre_expression,
25
+ published: published,
26
+ range_attribute_id: range_attribute_id,
27
+ range_chance: range_chance,
28
+ tracking_speed_attribute_id: tracking_speed_attribute_id
29
+ }
30
+ end
31
+
32
+ def description
33
+ options['description']
34
+ end
35
+
36
+ def disallow_auto_repeat
37
+ options['disallow_auto_repeat']
38
+ end
39
+
40
+ def discharge_attribute_id
41
+ options['discharge_attribute_id']
42
+ end
43
+
44
+ def display_name
45
+ options['display_name']
46
+ end
47
+
48
+ def duration_attribute_id
49
+ options['duration_attribute_id']
50
+ end
51
+
52
+ def effect_category
53
+ options['effect_category']
54
+ end
55
+
56
+ def effect_id
57
+ options['effect_id']
58
+ end
59
+
60
+ def electronic_chance
61
+ options['electronic_chance']
62
+ end
63
+
64
+ def falloff_attribute_id
65
+ options['falloff_attribute_id']
66
+ end
67
+
68
+ def icon_id
69
+ options['icon_id']
70
+ end
71
+
72
+ def is_assistance
73
+ options['is_assistance']
74
+ end
75
+
76
+ def is_offensive
77
+ options['is_offensive']
78
+ end
79
+
80
+ def is_warp_safe
81
+ options['is_warp_safe']
82
+ end
83
+
84
+ def name
85
+ options['name']
86
+ end
87
+
88
+ def post_expression
89
+ options['post_expression']
90
+ end
91
+
92
+ def pre_expression
93
+ options['pre_expression']
94
+ end
95
+
96
+ def published
97
+ options['published']
98
+ end
99
+
100
+ def range_attribute_id
101
+ options['range_attribute_id']
102
+ end
103
+
104
+ def range_chance
105
+ options['range_chance']
106
+ end
107
+
108
+ def tracking_speed_attribute_id
109
+ options['tracking_speed_attribute_id']
110
+ end
111
+
112
+ def modifiers
113
+ @modifiers ||= DogmaEffectModifiers.new(options['modifiers']).modifiers
114
+ end
115
+ end
116
+ end
117
+ end
118
+ end