eve_online 0.8.0 → 0.9.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (70) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +1 -1
  3. data/README.md +560 -17
  4. data/eve_online.gemspec +1 -0
  5. data/lib/eve_online.rb +33 -0
  6. data/lib/eve_online/account/api_key_info.rb +19 -14
  7. data/lib/eve_online/account/characters.rb +10 -5
  8. data/lib/eve_online/account/status.rb +4 -4
  9. data/lib/eve_online/base.rb +9 -4
  10. data/lib/eve_online/base_xml.rb +9 -4
  11. data/lib/eve_online/blueprint.rb +9 -9
  12. data/lib/eve_online/bookmark.rb +13 -11
  13. data/lib/eve_online/bookmark_folder.rb +21 -16
  14. data/lib/eve_online/character.rb +8 -8
  15. data/lib/eve_online/character_implants.rb +7 -1
  16. data/lib/eve_online/character_jump_clone_implants.rb +29 -0
  17. data/lib/eve_online/character_jump_clones.rb +7 -1
  18. data/lib/eve_online/character_skills.rb +7 -1
  19. data/lib/eve_online/characters/account_balance.rb +14 -8
  20. data/lib/eve_online/characters/asset_list.rb +12 -5
  21. data/lib/eve_online/characters/blueprints.rb +12 -5
  22. data/lib/eve_online/characters/bookmarks.rb +22 -17
  23. data/lib/eve_online/characters/calendar_event_attendees.rb +2 -0
  24. data/lib/eve_online/characters/character_sheet.rb +48 -37
  25. data/lib/eve_online/characters/chat_channels.rb +23 -0
  26. data/lib/eve_online/characters/contact_list.rb +2 -0
  27. data/lib/eve_online/characters/contact_notifications.rb +30 -0
  28. data/lib/eve_online/characters/contract_bids.rb +23 -0
  29. data/lib/eve_online/characters/contract_items.rb +24 -0
  30. data/lib/eve_online/characters/contracts.rb +26 -0
  31. data/lib/eve_online/characters/fac_war_stats.rb +23 -0
  32. data/lib/eve_online/characters/industry_jobs.rb +23 -0
  33. data/lib/eve_online/characters/industry_jobs_history.rb +23 -0
  34. data/lib/eve_online/characters/kill_mails.rb +25 -0
  35. data/lib/eve_online/characters/locations.rb +32 -0
  36. data/lib/eve_online/characters/mail_bodies.rb +30 -0
  37. data/lib/eve_online/characters/mail_messages.rb +23 -0
  38. data/lib/eve_online/characters/mailing_lists.rb +23 -0
  39. data/lib/eve_online/characters/market_orders.rb +55 -0
  40. data/lib/eve_online/characters/medals.rb +2 -0
  41. data/lib/eve_online/characters/notification_texts.rb +32 -0
  42. data/lib/eve_online/characters/notifications.rb +23 -0
  43. data/lib/eve_online/characters/planetary_colonies.rb +23 -0
  44. data/lib/eve_online/characters/planetary_links.rb +24 -0
  45. data/lib/eve_online/characters/planetary_pins.rb +24 -0
  46. data/lib/eve_online/characters/planetary_routes.rb +24 -0
  47. data/lib/eve_online/characters/research.rb +23 -0
  48. data/lib/eve_online/characters/skill_in_training.rb +10 -8
  49. data/lib/eve_online/characters/skill_queue.rb +51 -0
  50. data/lib/eve_online/characters/standings.rb +23 -21
  51. data/lib/eve_online/characters/upcoming_calendar_events.rb +12 -5
  52. data/lib/eve_online/characters/wallet_journal.rb +57 -0
  53. data/lib/eve_online/characters/wallet_transactions.rb +24 -0
  54. data/lib/eve_online/contact_notification.rb +42 -0
  55. data/lib/eve_online/corporations/market_orders.rb +55 -0
  56. data/lib/eve_online/eve/character_id.rb +9 -9
  57. data/lib/eve_online/event.rb +12 -10
  58. data/lib/eve_online/implant.rb +2 -2
  59. data/lib/eve_online/item.rb +7 -7
  60. data/lib/eve_online/jump_clone.rb +4 -4
  61. data/lib/eve_online/jump_clone_implant.rb +29 -0
  62. data/lib/eve_online/market_order.rb +91 -0
  63. data/lib/eve_online/server/status.rb +2 -2
  64. data/lib/eve_online/skill.rb +4 -4
  65. data/lib/eve_online/skill_queue_entry.rb +51 -0
  66. data/lib/eve_online/sovereignty/campaigns.rb +1 -1
  67. data/lib/eve_online/standing.rb +3 -3
  68. data/lib/eve_online/version.rb +1 -1
  69. data/lib/eve_online/wallet_journal_entry.rb +97 -0
  70. metadata +46 -2
@@ -0,0 +1,23 @@
1
+ module EveOnline
2
+ module Characters
3
+ # https://eveonline-third-party-documentation.readthedocs.io/en/latest/xmlapi/character/char_notifications.html
4
+ class Notifications < BaseXML
5
+ API_ENDPOINT = 'https://api.eveonline.com/char/Notifications.xml.aspx'.freeze
6
+
7
+ ACCESS_MASK = 16_384
8
+
9
+ attr_reader :key_id, :v_code, :character_id
10
+
11
+ def initialize(key_id, v_code, character_id)
12
+ super()
13
+ @key_id = key_id
14
+ @v_code = v_code
15
+ @character_id = character_id
16
+ end
17
+
18
+ def url
19
+ "#{ API_ENDPOINT }?keyID=#{ key_id }&vCode=#{ v_code }&characterID=#{ character_id }"
20
+ end
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,23 @@
1
+ module EveOnline
2
+ module Characters
3
+ # https://eveonline-third-party-documentation.readthedocs.io/en/latest/xmlapi/character/char_planetarycolonies.html
4
+ class PlanetaryColonies < BaseXML
5
+ API_ENDPOINT = 'https://api.eveonline.com/char/PlanetaryColonies.xml.aspx'.freeze
6
+
7
+ ACCESS_MASK = 2
8
+
9
+ attr_reader :key_id, :v_code, :character_id
10
+
11
+ def initialize(key_id, v_code, character_id)
12
+ super()
13
+ @key_id = key_id
14
+ @v_code = v_code
15
+ @character_id = character_id
16
+ end
17
+
18
+ def url
19
+ "#{ API_ENDPOINT }?keyID=#{ key_id }&vCode=#{ v_code }&characterID=#{ character_id }"
20
+ end
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,24 @@
1
+ module EveOnline
2
+ module Characters
3
+ # https://eveonline-third-party-documentation.readthedocs.io/en/latest/xmlapi/character/char_planetarylinks.html
4
+ class PlanetaryLinks < BaseXML
5
+ API_ENDPOINT = 'https://api.eveonline.com/char/PlanetaryLinks.xml.aspx'.freeze
6
+
7
+ ACCESS_MASK = 2
8
+
9
+ attr_reader :key_id, :v_code, :character_id, :planet_id
10
+
11
+ def initialize(key_id, v_code, character_id, planet_id)
12
+ super()
13
+ @key_id = key_id
14
+ @v_code = v_code
15
+ @character_id = character_id
16
+ @planet_id = planet_id
17
+ end
18
+
19
+ def url
20
+ "#{ API_ENDPOINT }?keyID=#{ key_id }&vCode=#{ v_code }&characterID=#{ character_id }&planetID=#{ planet_id }"
21
+ end
22
+ end
23
+ end
24
+ end
@@ -0,0 +1,24 @@
1
+ module EveOnline
2
+ module Characters
3
+ # https://eveonline-third-party-documentation.readthedocs.io/en/latest/xmlapi/character/char_planetarypins.html
4
+ class PlanetaryPins < BaseXML
5
+ API_ENDPOINT = 'https://api.eveonline.com/char/PlanetaryPins.xml.aspx'.freeze
6
+
7
+ ACCESS_MASK = 2
8
+
9
+ attr_reader :key_id, :v_code, :character_id, :planet_id
10
+
11
+ def initialize(key_id, v_code, character_id, planet_id)
12
+ super()
13
+ @key_id = key_id
14
+ @v_code = v_code
15
+ @character_id = character_id
16
+ @planet_id = planet_id
17
+ end
18
+
19
+ def url
20
+ "#{ API_ENDPOINT }?keyID=#{ key_id }&vCode=#{ v_code }&characterID=#{ character_id }&planetID=#{ planet_id }"
21
+ end
22
+ end
23
+ end
24
+ end
@@ -0,0 +1,24 @@
1
+ module EveOnline
2
+ module Characters
3
+ # https://eveonline-third-party-documentation.readthedocs.io/en/latest/xmlapi/character/char_planetaryroutes.html
4
+ class PlanetaryRoutes < BaseXML
5
+ API_ENDPOINT = 'https://api.eveonline.com/char/PlanetaryRoutes.xml.aspx'.freeze
6
+
7
+ ACCESS_MASK = 2
8
+
9
+ attr_reader :key_id, :v_code, :character_id, :planet_id
10
+
11
+ def initialize(key_id, v_code, character_id, planet_id)
12
+ super()
13
+ @key_id = key_id
14
+ @v_code = v_code
15
+ @character_id = character_id
16
+ @planet_id = planet_id
17
+ end
18
+
19
+ def url
20
+ "#{ API_ENDPOINT }?keyID=#{ key_id }&vCode=#{ v_code }&characterID=#{ character_id }&planetID=#{ planet_id }"
21
+ end
22
+ end
23
+ end
24
+ end
@@ -0,0 +1,23 @@
1
+ module EveOnline
2
+ module Characters
3
+ # https://eveonline-third-party-documentation.readthedocs.io/en/latest/xmlapi/character/char_research.html
4
+ class Research < BaseXML
5
+ API_ENDPOINT = 'https://api.eveonline.com/char/Research.xml.aspx'.freeze
6
+
7
+ ACCESS_MASK = 65_536
8
+
9
+ attr_reader :key_id, :v_code, :character_id
10
+
11
+ def initialize(key_id, v_code, character_id)
12
+ super()
13
+ @key_id = key_id
14
+ @v_code = v_code
15
+ @character_id = character_id
16
+ end
17
+
18
+ def url
19
+ "#{ API_ENDPOINT }?keyID=#{ key_id }&vCode=#{ v_code }&characterID=#{ character_id }"
20
+ end
21
+ end
22
+ end
23
+ end
@@ -4,6 +4,8 @@ module EveOnline
4
4
  class SkillInTraining < BaseXML
5
5
  API_ENDPOINT = 'https://api.eveonline.com/char/SkillInTraining.xml.aspx'.freeze
6
6
 
7
+ ACCESS_MASK = 131_072
8
+
7
9
  attr_reader :key_id, :v_code, :character_id
8
10
 
9
11
  def initialize(key_id, v_code, character_id)
@@ -27,35 +29,35 @@ module EveOnline
27
29
  end
28
30
 
29
31
  def current_tq_time
30
- @current_tq_time ||= parse_datetime_with_timezone(result.fetch('currentTQTime'))
32
+ parse_datetime_with_timezone(result.fetch('currentTQTime'))
31
33
  end
32
34
 
33
35
  def training_end_time
34
- @training_end_time ||= parse_datetime_with_timezone(result.fetch('trainingEndTime'))
36
+ parse_datetime_with_timezone(result.fetch('trainingEndTime'))
35
37
  end
36
38
 
37
39
  def training_start_time
38
- @training_start_time ||= parse_datetime_with_timezone(result.fetch('trainingStartTime'))
40
+ parse_datetime_with_timezone(result.fetch('trainingStartTime'))
39
41
  end
40
42
 
41
43
  def training_type_id
42
- @training_type_id ||= result.fetch('trainingTypeID').to_i
44
+ result.fetch('trainingTypeID').to_i
43
45
  end
44
46
 
45
47
  def training_start_sp
46
- @training_start_sp ||= result.fetch('trainingStartSP').to_i
48
+ result.fetch('trainingStartSP').to_i
47
49
  end
48
50
 
49
51
  def training_destination_sp
50
- @training_destination_sp ||= result.fetch('trainingDestinationSP').to_i
52
+ result.fetch('trainingDestinationSP').to_i
51
53
  end
52
54
 
53
55
  def training_to_level
54
- @training_to_level ||= result.fetch('trainingToLevel').to_i
56
+ result.fetch('trainingToLevel').to_i
55
57
  end
56
58
 
57
59
  def skill_in_training
58
- @skill_in_training ||= result.fetch('skillInTraining').to_i
60
+ result.fetch('skillInTraining').to_i
59
61
  end
60
62
 
61
63
  def url
@@ -0,0 +1,51 @@
1
+ module EveOnline
2
+ module Characters
3
+ # https://eveonline-third-party-documentation.readthedocs.io/en/latest/xmlapi/character/char_skillqueue.html
4
+ class SkillQueue < BaseXML
5
+ API_ENDPOINT = 'https://api.eveonline.com/char/SkillQueue.xml.aspx'.freeze
6
+
7
+ ACCESS_MASK = 262_144
8
+
9
+ attr_reader :key_id, :v_code, :character_id
10
+
11
+ def initialize(key_id, v_code, character_id)
12
+ super()
13
+ @key_id = key_id
14
+ @v_code = v_code
15
+ @character_id = character_id
16
+ end
17
+
18
+ def skills
19
+ case row
20
+ when Hash
21
+ [SkillQueueEntry.new(row)]
22
+ when Array
23
+ output = []
24
+ row.each do |blueprint|
25
+ output << SkillQueueEntry.new(blueprint)
26
+ end
27
+ output
28
+ else
29
+ raise ArgumentError
30
+ end
31
+ end
32
+ memoize :skills
33
+
34
+ def url
35
+ "#{ API_ENDPOINT }?keyID=#{ key_id }&vCode=#{ v_code }&characterID=#{ character_id }"
36
+ end
37
+
38
+ private
39
+
40
+ def rowset
41
+ result.fetch('rowset')
42
+ end
43
+ memoize :rowset
44
+
45
+ def row
46
+ rowset.fetch('row')
47
+ end
48
+ memoize :row
49
+ end
50
+ end
51
+ end
@@ -4,6 +4,8 @@ module EveOnline
4
4
  class Standings < BaseXML
5
5
  API_ENDPOINT = 'https://api.eveonline.com/char/Standings.xml.aspx'.freeze
6
6
 
7
+ ACCESS_MASK = 524_288
8
+
7
9
  attr_reader :key_id, :v_code, :character_id
8
10
 
9
11
  def initialize(key_id, v_code, character_id)
@@ -14,34 +16,31 @@ module EveOnline
14
16
  end
15
17
 
16
18
  def agents
17
- @agents ||= begin
18
- output = []
19
- agents_rowset.each do |agent|
20
- output << Standing.new(agent)
21
- end
22
- output
19
+ output = []
20
+ agents_rowset.each do |agent|
21
+ output << Standing.new(agent)
23
22
  end
23
+ output
24
24
  end
25
+ memoize :agents
25
26
 
26
27
  def npc_corporations
27
- @npc_corporations ||= begin
28
- output = []
29
- npc_corporations_rowset.each do |agent|
30
- output << Standing.new(agent)
31
- end
32
- output
28
+ output = []
29
+ npc_corporations_rowset.each do |agent|
30
+ output << Standing.new(agent)
33
31
  end
32
+ output
34
33
  end
34
+ memoize :npc_corporations
35
35
 
36
36
  def factions
37
- @factions ||= begin
38
- output = []
39
- factions_rowset.each do |agent|
40
- output << Standing.new(agent)
41
- end
42
- output
37
+ output = []
38
+ factions_rowset.each do |agent|
39
+ output << Standing.new(agent)
43
40
  end
41
+ output
44
42
  end
43
+ memoize :factions
45
44
 
46
45
  def url
47
46
  "#{ API_ENDPOINT }?keyID=#{ key_id }&vCode=#{ v_code }&characterID=#{ character_id }"
@@ -50,16 +49,19 @@ module EveOnline
50
49
  private
51
50
 
52
51
  def agents_rowset
53
- @agents_rowset ||= result.fetch('characterNPCStandings').fetch('rowset').reject { |a| a.fetch('@name') != 'agents' }.first.fetch('row')
52
+ result.fetch('characterNPCStandings').fetch('rowset').reject { |a| a.fetch('@name') != 'agents' }.first.fetch('row')
54
53
  end
54
+ memoize :agents_rowset
55
55
 
56
56
  def npc_corporations_rowset
57
- @npc_corporations_rowset ||= result.fetch('characterNPCStandings').fetch('rowset').reject { |a| a.fetch('@name') != 'NPCCorporations' }.first.fetch('row')
57
+ result.fetch('characterNPCStandings').fetch('rowset').reject { |a| a.fetch('@name') != 'NPCCorporations' }.first.fetch('row')
58
58
  end
59
+ memoize :npc_corporations_rowset
59
60
 
60
61
  def factions_rowset
61
- @factions_rowset ||= result.fetch('characterNPCStandings').fetch('rowset').reject { |a| a.fetch('@name') != 'factions' }.first.fetch('row')
62
+ result.fetch('characterNPCStandings').fetch('rowset').reject { |a| a.fetch('@name') != 'factions' }.first.fetch('row')
62
63
  end
64
+ memoize :factions_rowset
63
65
  end
64
66
  end
65
67
  end
@@ -4,6 +4,8 @@ module EveOnline
4
4
  class UpcomingCalendarEvents < BaseXML
5
5
  API_ENDPOINT = 'https://api.eveonline.com/char/UpcomingCalendarEvents.xml.aspx'.freeze
6
6
 
7
+ ACCESS_MASK = 1_048_576
8
+
7
9
  attr_reader :key_id, :v_code, :character_id
8
10
 
9
11
  def initialize(key_id, v_code, character_id)
@@ -27,18 +29,23 @@ module EveOnline
27
29
  raise ArgumentError
28
30
  end
29
31
  end
32
+ memoize :events
30
33
 
31
- def row
32
- @row ||= rowset.fetch('row')
34
+ def url
35
+ "#{ API_ENDPOINT }?keyID=#{ key_id }&vCode=#{ v_code }&characterID=#{ character_id }"
33
36
  end
34
37
 
38
+ private
39
+
35
40
  def rowset
36
- @rowset ||= result.fetch('rowset')
41
+ result.fetch('rowset')
37
42
  end
43
+ memoize :rowset
38
44
 
39
- def url
40
- "#{ API_ENDPOINT }?keyID=#{ key_id }&vCode=#{ v_code }&characterID=#{ character_id }"
45
+ def row
46
+ rowset.fetch('row')
41
47
  end
48
+ memoize :row
42
49
  end
43
50
  end
44
51
  end
@@ -0,0 +1,57 @@
1
+ module EveOnline
2
+ module Characters
3
+ # https://eveonline-third-party-documentation.readthedocs.io/en/latest/xmlapi/character/char_walletjournal.html
4
+ class WalletJournal < BaseXML
5
+ API_ENDPOINT = 'https://api.eveonline.com/char/WalletJournal.xml.aspx'.freeze
6
+
7
+ ACCESS_MASK = 2_097_152
8
+
9
+ attr_reader :key_id, :v_code, :character_id, :account_key, :from_id, :row_count
10
+
11
+ def initialize(key_id, v_code, character_id, options = {})
12
+ super()
13
+ @key_id = key_id
14
+ @v_code = v_code
15
+ @character_id = character_id
16
+ @account_key = options.fetch(:account_key, 1000)
17
+ @from_id = options.fetch(:from_id, nil)
18
+ @row_count = options.fetch(:row_count, nil)
19
+ end
20
+
21
+ def wallet_journal_entries
22
+ case row
23
+ when Hash
24
+ [WalletJournalEntry.new(row)]
25
+ when Array
26
+ output = []
27
+ row.each do |blueprint|
28
+ output << WalletJournalEntry.new(blueprint)
29
+ end
30
+ output
31
+ else
32
+ raise ArgumentError
33
+ end
34
+ end
35
+ memoize :wallet_journal_entries
36
+
37
+ def url
38
+ output = "#{ API_ENDPOINT }?keyID=#{ key_id }&vCode=#{ v_code }&characterID=#{ character_id }&accountKey=#{ account_key }"
39
+ output = "#{ output }&fromID=#{ from_id }" if from_id
40
+ output = "#{ output }&rowCount=#{ row_count }" if row_count
41
+ output
42
+ end
43
+
44
+ private
45
+
46
+ def rowset
47
+ result.fetch('rowset')
48
+ end
49
+ memoize :rowset
50
+
51
+ def row
52
+ rowset.fetch('row')
53
+ end
54
+ memoize :row
55
+ end
56
+ end
57
+ end
@@ -0,0 +1,24 @@
1
+ module EveOnline
2
+ module Characters
3
+ # https://eveonline-third-party-documentation.readthedocs.io/en/latest/xmlapi/character/char_wallettransactions.html
4
+ class WalletTransactions < BaseXML
5
+ API_ENDPOINT = 'https://api.eveonline.com/char/WalletTransactions.xml.aspx'.freeze
6
+
7
+ ACCESS_MASK = 4_194_304
8
+
9
+ attr_reader :key_id, :v_code, :character_id # TODO: :account_key
10
+
11
+ def initialize(key_id, v_code, character_id) # TODO: account_key
12
+ super()
13
+ @key_id = key_id
14
+ @v_code = v_code
15
+ @character_id = character_id
16
+ # @account_key = account_key TODO: add
17
+ end
18
+
19
+ def url
20
+ "#{ API_ENDPOINT }?keyID=#{ key_id }&vCode=#{ v_code }&characterID=#{ character_id }"
21
+ end
22
+ end
23
+ end
24
+ end