eve_online 0.19.0 → 0.20.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (42) hide show
  1. checksums.yaml +4 -4
  2. data/.ruby-version +1 -1
  3. data/.travis.yml +5 -5
  4. data/CHANGELOG.md +34 -0
  5. data/Gemfile.lock +6 -6
  6. data/README.md +410 -14
  7. data/lib/eve_online.rb +31 -0
  8. data/lib/eve_online/esi/alliance.rb +1 -2
  9. data/lib/eve_online/esi/alliance_icon.rb +1 -2
  10. data/lib/eve_online/esi/models/asteroid_belt.rb +28 -0
  11. data/lib/eve_online/esi/models/category.rb +33 -0
  12. data/lib/eve_online/esi/models/graphic.rb +54 -0
  13. data/lib/eve_online/esi/models/group.rb +38 -0
  14. data/lib/eve_online/esi/models/moon.rb +33 -0
  15. data/lib/eve_online/esi/models/planet.rb +38 -0
  16. data/lib/eve_online/esi/models/planet_short.rb +27 -0
  17. data/lib/eve_online/esi/models/planets.rb +19 -0
  18. data/lib/eve_online/esi/models/star.rb +54 -0
  19. data/lib/eve_online/esi/models/stargate.rb +42 -0
  20. data/lib/eve_online/esi/models/stargate_destination.rb +24 -0
  21. data/lib/eve_online/esi/models/station.rb +73 -0
  22. data/lib/eve_online/esi/models/system.rb +60 -0
  23. data/lib/eve_online/esi/models/system_jump.rb +24 -0
  24. data/lib/eve_online/esi/models/system_kill.rb +34 -0
  25. data/lib/eve_online/esi/universe_asteroid_belt.rb +33 -0
  26. data/lib/eve_online/esi/universe_categories.rb +19 -0
  27. data/lib/eve_online/esi/universe_category.rb +34 -0
  28. data/lib/eve_online/esi/universe_graphic.rb +35 -0
  29. data/lib/eve_online/esi/universe_graphics.rb +19 -0
  30. data/lib/eve_online/esi/universe_group.rb +34 -0
  31. data/lib/eve_online/esi/universe_groups.rb +27 -0
  32. data/lib/eve_online/esi/universe_moon.rb +33 -0
  33. data/lib/eve_online/esi/universe_planet.rb +34 -0
  34. data/lib/eve_online/esi/universe_star.rb +35 -0
  35. data/lib/eve_online/esi/universe_stargate.rb +35 -0
  36. data/lib/eve_online/esi/universe_station.rb +37 -0
  37. data/lib/eve_online/esi/universe_structures.rb +19 -0
  38. data/lib/eve_online/esi/universe_system.rb +35 -0
  39. data/lib/eve_online/esi/universe_system_jumps.rb +24 -0
  40. data/lib/eve_online/esi/universe_system_kills.rb +24 -0
  41. data/lib/eve_online/version.rb +1 -1
  42. metadata +33 -2
@@ -0,0 +1,24 @@
1
+ # frozen_string_literal: true
2
+
3
+ module EveOnline
4
+ module ESI
5
+ module Models
6
+ class StargateDestination < Base
7
+ def as_json
8
+ {
9
+ stargate_id: stargate_id,
10
+ system_id: system_id
11
+ }
12
+ end
13
+
14
+ def stargate_id
15
+ options['stargate_id']
16
+ end
17
+
18
+ def system_id
19
+ options['system_id']
20
+ end
21
+ end
22
+ end
23
+ end
24
+ end
@@ -0,0 +1,73 @@
1
+ # frozen_string_literal: true
2
+
3
+ module EveOnline
4
+ module ESI
5
+ module Models
6
+ class Station < Base
7
+ def as_json
8
+ {
9
+ max_dockable_ship_volume: max_dockable_ship_volume,
10
+ name: name,
11
+ office_rental_cost: office_rental_cost,
12
+ owner: owner,
13
+ race_id: race_id,
14
+ reprocessing_efficiency: reprocessing_efficiency,
15
+ reprocessing_stations_take: reprocessing_stations_take,
16
+ services: services,
17
+ station_id: station_id,
18
+ system_id: system_id,
19
+ type_id: type_id
20
+ }
21
+ end
22
+
23
+ def max_dockable_ship_volume
24
+ options['max_dockable_ship_volume']
25
+ end
26
+
27
+ def name
28
+ options['name']
29
+ end
30
+
31
+ def office_rental_cost
32
+ options['office_rental_cost']
33
+ end
34
+
35
+ def owner
36
+ options['owner']
37
+ end
38
+
39
+ def race_id
40
+ options['race_id']
41
+ end
42
+
43
+ def reprocessing_efficiency
44
+ options['reprocessing_efficiency']
45
+ end
46
+
47
+ def reprocessing_stations_take
48
+ options['reprocessing_stations_take']
49
+ end
50
+
51
+ def services
52
+ options['services']
53
+ end
54
+
55
+ def station_id
56
+ options['station_id']
57
+ end
58
+
59
+ def system_id
60
+ options['system_id']
61
+ end
62
+
63
+ def type_id
64
+ options['type_id']
65
+ end
66
+
67
+ def position
68
+ @position ||= Position.new(options['position'])
69
+ end
70
+ end
71
+ end
72
+ end
73
+ end
@@ -0,0 +1,60 @@
1
+ # frozen_string_literal: true
2
+
3
+ module EveOnline
4
+ module ESI
5
+ module Models
6
+ class System < Base
7
+ def as_json
8
+ {
9
+ constellation_id: constellation_id,
10
+ name: name,
11
+ security_class: security_class,
12
+ security_status: security_status,
13
+ star_id: star_id,
14
+ system_id: system_id
15
+ }
16
+ end
17
+
18
+ def constellation_id
19
+ options['constellation_id']
20
+ end
21
+
22
+ def name
23
+ options['name']
24
+ end
25
+
26
+ def security_class
27
+ options['security_class']
28
+ end
29
+
30
+ def security_status
31
+ options['security_status']
32
+ end
33
+
34
+ def star_id
35
+ options['star_id']
36
+ end
37
+
38
+ def system_id
39
+ options['system_id']
40
+ end
41
+
42
+ def position
43
+ @position ||= Position.new(options['position'])
44
+ end
45
+
46
+ def planets
47
+ @planets ||= Planets.new(options.fetch('planets', [])).planets
48
+ end
49
+
50
+ def stargate_ids
51
+ options.fetch('stargates', [])
52
+ end
53
+
54
+ def station_ids
55
+ options.fetch('stations', [])
56
+ end
57
+ end
58
+ end
59
+ end
60
+ end
@@ -0,0 +1,24 @@
1
+ # frozen_string_literal: true
2
+
3
+ module EveOnline
4
+ module ESI
5
+ module Models
6
+ class SystemJump < Base
7
+ def as_json
8
+ {
9
+ ship_jumps: ship_jumps,
10
+ system_id: system_id
11
+ }
12
+ end
13
+
14
+ def ship_jumps
15
+ options['ship_jumps']
16
+ end
17
+
18
+ def system_id
19
+ options['system_id']
20
+ end
21
+ end
22
+ end
23
+ end
24
+ end
@@ -0,0 +1,34 @@
1
+ # frozen_string_literal: true
2
+
3
+ module EveOnline
4
+ module ESI
5
+ module Models
6
+ class SystemKill < Base
7
+ def as_json
8
+ {
9
+ npc_kills: npc_kills,
10
+ pod_kills: pod_kills,
11
+ ship_kills: ship_kills,
12
+ system_id: system_id
13
+ }
14
+ end
15
+
16
+ def npc_kills
17
+ options['npc_kills']
18
+ end
19
+
20
+ def pod_kills
21
+ options['pod_kills']
22
+ end
23
+
24
+ def ship_kills
25
+ options['ship_kills']
26
+ end
27
+
28
+ def system_id
29
+ options['system_id']
30
+ end
31
+ end
32
+ end
33
+ end
34
+ end
@@ -0,0 +1,33 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'forwardable'
4
+
5
+ module EveOnline
6
+ module ESI
7
+ class UniverseAsteroidBelt < Base
8
+ extend Forwardable
9
+
10
+ API_ENDPOINT = 'https://esi.evetech.net/v1/universe/asteroid_belts/%<asteroid_belt_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, :name, :system_id, :position
21
+
22
+ def model
23
+ @model ||= Models::AsteroidBelt.new(response)
24
+ end
25
+
26
+ def scope; end
27
+
28
+ def url
29
+ format(API_ENDPOINT, asteroid_belt_id: id, datasource: datasource)
30
+ end
31
+ end
32
+ end
33
+ end
@@ -0,0 +1,19 @@
1
+ # frozen_string_literal: true
2
+
3
+ module EveOnline
4
+ module ESI
5
+ class UniverseCategories < Base
6
+ API_ENDPOINT = 'https://esi.evetech.net/v1/universe/categories/?datasource=%<datasource>s'
7
+
8
+ def category_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
@@ -0,0 +1,34 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'forwardable'
4
+
5
+ module EveOnline
6
+ module ESI
7
+ class UniverseCategory < Base
8
+ extend Forwardable
9
+
10
+ API_ENDPOINT = 'https://esi.evetech.net/v1/universe/categories/%<category_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, :category_id, :name, :published,
21
+ :group_ids
22
+
23
+ def model
24
+ @model ||= Models::Category.new(response)
25
+ end
26
+
27
+ def scope; end
28
+
29
+ def url
30
+ format(API_ENDPOINT, category_id: id, datasource: datasource)
31
+ end
32
+ end
33
+ end
34
+ end
@@ -0,0 +1,35 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'forwardable'
4
+
5
+ module EveOnline
6
+ module ESI
7
+ class UniverseGraphic < Base
8
+ extend Forwardable
9
+
10
+ API_ENDPOINT = 'https://esi.evetech.net/v1/universe/graphics/%<graphic_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, :collision_file, :graphic_file,
21
+ :graphic_id, :icon_folder, :sof_dna, :sof_fation_name,
22
+ :sof_hull_name, :sof_race_name
23
+
24
+ def model
25
+ @model ||= Models::Graphic.new(response)
26
+ end
27
+
28
+ def scope; end
29
+
30
+ def url
31
+ format(API_ENDPOINT, graphic_id: id, datasource: datasource)
32
+ end
33
+ end
34
+ end
35
+ end
@@ -0,0 +1,19 @@
1
+ # frozen_string_literal: true
2
+
3
+ module EveOnline
4
+ module ESI
5
+ class UniverseGraphics < Base
6
+ API_ENDPOINT = 'https://esi.evetech.net/v1/universe/graphics/?datasource=%<datasource>s'
7
+
8
+ def graphic_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
@@ -0,0 +1,34 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'forwardable'
4
+
5
+ module EveOnline
6
+ module ESI
7
+ class UniverseGroup < Base
8
+ extend Forwardable
9
+
10
+ API_ENDPOINT = 'https://esi.evetech.net/v1/universe/groups/%<group_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, :category_id, :group_id, :name,
21
+ :published, :type_ids
22
+
23
+ def model
24
+ @model ||= Models::Group.new(response)
25
+ end
26
+
27
+ def scope; end
28
+
29
+ def url
30
+ format(API_ENDPOINT, group_id: id, datasource: datasource)
31
+ end
32
+ end
33
+ end
34
+ end
@@ -0,0 +1,27 @@
1
+ # frozen_string_literal: true
2
+
3
+ module EveOnline
4
+ module ESI
5
+ class UniverseGroups < Base
6
+ API_ENDPOINT = 'https://esi.evetech.net/v1/universe/groups/?datasource=%<datasource>s&page=%<page>s'
7
+
8
+ attr_reader :page
9
+
10
+ def initialize(options = {})
11
+ super
12
+
13
+ @page = options.fetch(:page, 1)
14
+ end
15
+
16
+ def group_ids
17
+ response
18
+ end
19
+
20
+ def scope; end
21
+
22
+ def url
23
+ format(API_ENDPOINT, datasource: datasource, page: page)
24
+ end
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,33 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'forwardable'
4
+
5
+ module EveOnline
6
+ module ESI
7
+ class UniverseMoon < Base
8
+ extend Forwardable
9
+
10
+ API_ENDPOINT = 'https://esi.evetech.net/v1/universe/moons/%<moon_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, :moon_id, :name, :system_id, :position
21
+
22
+ def model
23
+ @model ||= Models::Moon.new(response)
24
+ end
25
+
26
+ def scope; end
27
+
28
+ def url
29
+ format(API_ENDPOINT, moon_id: id, datasource: datasource)
30
+ end
31
+ end
32
+ end
33
+ end