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_chatchannels.html
4
+ class ChatChannels < BaseXML
5
+ API_ENDPOINT = 'https://api.eveonline.com/char/ChatChannels.xml.aspx'.freeze
6
+
7
+ ACCESS_MASK = 536_870_912
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 ContactList < BaseXML
5
5
  API_ENDPOINT = 'https://api.eveonline.com/char/ContactList.xml.aspx'.freeze
6
6
 
7
+ ACCESS_MASK = 16
8
+
7
9
  attr_reader :key_id, :v_code, :character_id
8
10
 
9
11
  def initialize(key_id, v_code, character_id)
@@ -4,6 +4,8 @@ module EveOnline
4
4
  class ContactNotifications < BaseXML
5
5
  API_ENDPOINT = 'https://api.eveonline.com/char/ContactNotifications.xml.aspx'.freeze
6
6
 
7
+ ACCESS_MASK = 32
8
+
7
9
  attr_reader :key_id, :v_code, :character_id
8
10
 
9
11
  def initialize(key_id, v_code, character_id)
@@ -13,9 +15,37 @@ module EveOnline
13
15
  @character_id = character_id
14
16
  end
15
17
 
18
+ def contact_notifications
19
+ case row
20
+ when Hash
21
+ [ContactNotification.new(row)]
22
+ when Array
23
+ output = []
24
+ row.each do |contact_notification|
25
+ output << ContactNotification.new(contact_notification)
26
+ end
27
+ output
28
+ else
29
+ raise ArgumentError
30
+ end
31
+ end
32
+ memoize :contact_notifications
33
+
16
34
  def url
17
35
  "#{ API_ENDPOINT }?keyID=#{ key_id }&vCode=#{ v_code }&characterID=#{ character_id }"
18
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
19
49
  end
20
50
  end
21
51
  end
@@ -0,0 +1,23 @@
1
+ module EveOnline
2
+ module Characters
3
+ # https://eveonline-third-party-documentation.readthedocs.io/en/latest/xmlapi/character/char_contractbids.html
4
+ class ContractBids < BaseXML
5
+ API_ENDPOINT = 'https://api.eveonline.com/char/ContractBids.xml.aspx'.freeze
6
+
7
+ ACCESS_MASK = 67_108_864
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_contractitems.html
4
+ class ContractItems < BaseXML
5
+ API_ENDPOINT = 'https://api.eveonline.com/char/ContractItems.xml.aspx'.freeze
6
+
7
+ ACCESS_MASK = 67_108_864
8
+
9
+ attr_reader :key_id, :v_code, :character_id, :contract_id
10
+
11
+ def initialize(key_id, v_code, character_id, contract_id)
12
+ super()
13
+ @key_id = key_id
14
+ @v_code = v_code
15
+ @character_id = character_id
16
+ @contract_id = contract_id
17
+ end
18
+
19
+ def url
20
+ "#{ API_ENDPOINT }?keyID=#{ key_id }&vCode=#{ v_code }&characterID=#{ character_id }&contractID=#{ contract_id }"
21
+ end
22
+ end
23
+ end
24
+ end
@@ -0,0 +1,26 @@
1
+ module EveOnline
2
+ module Characters
3
+ # https://eveonline-third-party-documentation.readthedocs.io/en/latest/xmlapi/character/char_contracts.html
4
+ class Contracts < BaseXML
5
+ API_ENDPOINT = 'https://api.eveonline.com/char/Contracts.xml.aspx'.freeze
6
+
7
+ ACCESS_MASK = 67_108_864
8
+
9
+ # attr_reader :key_id, :v_code, :character_id, :contract_id
10
+ attr_reader :key_id, :v_code, :character_id
11
+
12
+ # def initialize(key_id, v_code, character_id, contract_id = nil)
13
+ def initialize(key_id, v_code, character_id)
14
+ super()
15
+ @key_id = key_id
16
+ @v_code = v_code
17
+ @character_id = character_id
18
+ end
19
+
20
+ def url
21
+ # TODO: add support for contract_id
22
+ "#{ API_ENDPOINT }?keyID=#{ key_id }&vCode=#{ v_code }&characterID=#{ character_id }"
23
+ end
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,23 @@
1
+ module EveOnline
2
+ module Characters
3
+ # https://eveonline-third-party-documentation.readthedocs.io/en/latest/xmlapi/character/char_facwarstats.html
4
+ class FacWarStats < BaseXML
5
+ API_ENDPOINT = 'https://api.eveonline.com/char/FacWarStats.xml.aspx'.freeze
6
+
7
+ ACCESS_MASK = 64
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_industryjobs.html
4
+ class IndustryJobs < BaseXML
5
+ API_ENDPOINT = 'https://api.eveonline.com/char/IndustryJobs.xml.aspx'.freeze
6
+
7
+ ACCESS_MASK = 128
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_industryjobshistory.html
4
+ class IndustryJobsHistory < BaseXML
5
+ API_ENDPOINT = 'https://api.eveonline.com/char/IndustryJobsHistory.xml.aspx'.freeze
6
+
7
+ ACCESS_MASK = 128
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,25 @@
1
+ module EveOnline
2
+ module Characters
3
+ # https://eveonline-third-party-documentation.readthedocs.io/en/latest/xmlapi/character/char_killmails.html
4
+ class KillMails < BaseXML
5
+ API_ENDPOINT = 'https://api.eveonline.com/char/KillMails.xml.aspx'.freeze
6
+
7
+ ACCESS_MASK = 256
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
+ # TODO: @from_id
17
+ # TODO: row_count
18
+ end
19
+
20
+ def url
21
+ "#{ API_ENDPOINT }?keyID=#{ key_id }&vCode=#{ v_code }&characterID=#{ character_id }"
22
+ end
23
+ end
24
+ end
25
+ end
@@ -0,0 +1,32 @@
1
+ require 'uri'
2
+
3
+ module EveOnline
4
+ module Characters
5
+ # https://eveonline-third-party-documentation.readthedocs.io/en/latest/xmlapi/character/char_locations.html
6
+ class Locations < BaseXML
7
+ API_ENDPOINT = 'https://api.eveonline.com/char/Locations.xml.aspx'.freeze
8
+
9
+ ACCESS_MASK = 134_217_728
10
+
11
+ attr_reader :key_id, :v_code, :character_id, :ids
12
+
13
+ def initialize(key_id, v_code, character_id, ids)
14
+ super()
15
+ @key_id = key_id
16
+ @v_code = v_code
17
+ @character_id = character_id
18
+ @ids = ids
19
+ end
20
+
21
+ def url
22
+ "#{ API_ENDPOINT }?keyID=#{ key_id }&vCode=#{ v_code }&characterID=#{ character_id }&IDs=#{ escaped_ids }"
23
+ end
24
+
25
+ private
26
+
27
+ def escaped_ids
28
+ URI.escape(ids.join(','))
29
+ end
30
+ end
31
+ end
32
+ end
@@ -0,0 +1,30 @@
1
+ module EveOnline
2
+ module Characters
3
+ # https://eveonline-third-party-documentation.readthedocs.io/en/latest/xmlapi/character/char_mailbodies.html
4
+ class MailBodies < BaseXML
5
+ API_ENDPOINT = 'https://api.eveonline.com/char/MailBodies.xml.aspx'.freeze
6
+
7
+ ACCESS_MASK = 512
8
+
9
+ attr_reader :key_id, :v_code, :character_id, :ids
10
+
11
+ def initialize(key_id, v_code, character_id, ids)
12
+ super()
13
+ @key_id = key_id
14
+ @v_code = v_code
15
+ @character_id = character_id
16
+ @ids = ids
17
+ end
18
+
19
+ def url
20
+ "#{ API_ENDPOINT }?keyID=#{ key_id }&vCode=#{ v_code }&characterID=#{ character_id }&IDs=#{ escaped_ids }"
21
+ end
22
+
23
+ private
24
+
25
+ def escaped_ids
26
+ URI.escape(ids.join(','))
27
+ end
28
+ end
29
+ end
30
+ end
@@ -0,0 +1,23 @@
1
+ module EveOnline
2
+ module Characters
3
+ # https://eveonline-third-party-documentation.readthedocs.io/en/latest/xmlapi/character/char_mailmessages.html
4
+ class MailMessages < BaseXML
5
+ API_ENDPOINT = 'https://api.eveonline.com/char/MailMessages.xml.aspx'.freeze
6
+
7
+ ACCESS_MASK = 2_048
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_mailinglists.html
4
+ class MailingLists < BaseXML
5
+ API_ENDPOINT = 'https://api.eveonline.com/char/mailinglists.xml.aspx'.freeze
6
+
7
+ ACCESS_MASK = 1_024
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,55 @@
1
+ module EveOnline
2
+ module Characters
3
+ # https://eveonline-third-party-documentation.readthedocs.io/en/latest/xmlapi/character/char_marketorders.html
4
+ class MarketOrders < BaseXML
5
+ API_ENDPOINT = 'https://api.eveonline.com/char/MarketOrders.xml.aspx'.freeze
6
+
7
+ ACCESS_MASK = 4_096
8
+
9
+ attr_reader :key_id, :v_code, :character_id, :order_id
10
+
11
+ def initialize(key_id, v_code, options = {})
12
+ super()
13
+ @key_id = key_id
14
+ @v_code = v_code
15
+ @character_id = options.fetch(:character_id, nil)
16
+ @order_id = options.fetch(:order_id, nil)
17
+ end
18
+
19
+ def orders
20
+ case row
21
+ when Hash
22
+ [MarketOrder.new(row)]
23
+ when Array
24
+ output = []
25
+ row.each do |order|
26
+ output << MarketOrder.new(order)
27
+ end
28
+ output
29
+ else
30
+ raise ArgumentError
31
+ end
32
+ end
33
+ memoize :orders
34
+
35
+ def url
36
+ output = "#{ API_ENDPOINT }?keyID=#{ key_id }&vCode=#{ v_code }"
37
+ output = "#{ output }&characterID=#{ character_id }" if character_id
38
+ output = "#{ output }&orderID=#{ order_id }" if order_id
39
+ output
40
+ end
41
+
42
+ private
43
+
44
+ def rowset
45
+ result.fetch('rowset')
46
+ end
47
+ memoize :rowset
48
+
49
+ def row
50
+ rowset.fetch('row')
51
+ end
52
+ memoize :row
53
+ end
54
+ end
55
+ end
@@ -4,6 +4,8 @@ module EveOnline
4
4
  class Medals < BaseXML
5
5
  API_ENDPOINT = 'https://api.eveonline.com/char/Medals.xml.aspx'.freeze
6
6
 
7
+ ACCESS_MASK = 8_192
8
+
7
9
  attr_reader :key_id, :v_code, :character_id
8
10
 
9
11
  def initialize(key_id, v_code, character_id)
@@ -0,0 +1,32 @@
1
+ require 'uri'
2
+
3
+ module EveOnline
4
+ module Characters
5
+ # https://eveonline-third-party-documentation.readthedocs.io/en/latest/xmlapi/character/char_notificationtexts.html
6
+ class NotificationTexts < BaseXML
7
+ API_ENDPOINT = 'https://api.eveonline.com/char/NotificationTexts.xml.aspx'.freeze
8
+
9
+ ACCESS_MASK = 32_768
10
+
11
+ attr_reader :key_id, :v_code, :character_id, :ids
12
+
13
+ def initialize(key_id, v_code, character_id, ids)
14
+ super()
15
+ @key_id = key_id
16
+ @v_code = v_code
17
+ @character_id = character_id
18
+ @ids = ids
19
+ end
20
+
21
+ def url
22
+ "#{ API_ENDPOINT }?keyID=#{ key_id }&vCode=#{ v_code }&characterID=#{ character_id }&IDs=#{ escaped_ids }"
23
+ end
24
+
25
+ private
26
+
27
+ def escaped_ids
28
+ URI.escape(ids.join(','))
29
+ end
30
+ end
31
+ end
32
+ end