warframe 0.1.3 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. checksums.yaml +4 -4
  2. data/.yardopts +3 -3
  3. data/README.md +99 -75
  4. data/lib/warframe/cache.rb +37 -0
  5. data/lib/warframe/client_wrapper.rb +39 -37
  6. data/lib/warframe/models/alert.rb +30 -29
  7. data/lib/warframe/models/attributes/active.rb +31 -31
  8. data/lib/warframe/models/attributes/description.rb +21 -14
  9. data/lib/warframe/models/attributes/eta.rb +14 -14
  10. data/lib/warframe/models/attributes/expiry.rb +30 -30
  11. data/lib/warframe/models/attributes/id.rb +14 -14
  12. data/lib/warframe/models/attributes/reward_types.rb +14 -14
  13. data/lib/warframe/models/attributes/start_string.rb +14 -14
  14. data/lib/warframe/models/attributes/translations.rb +18 -18
  15. data/lib/warframe/models/base.rb +36 -36
  16. data/lib/warframe/models/cambion_drift.rb +26 -0
  17. data/lib/warframe/models/cetus.rb +40 -0
  18. data/lib/warframe/models/conclave_challenge.rb +54 -0
  19. data/lib/warframe/models/global_upgrade.rb +41 -40
  20. data/lib/warframe/models/invasion.rb +71 -70
  21. data/lib/warframe/models/news.rb +54 -53
  22. data/lib/warframe/models/nightwave.rb +40 -39
  23. data/lib/warframe/models/sortie.rb +36 -0
  24. data/lib/warframe/models/steel_path.rb +34 -0
  25. data/lib/warframe/models/syndicate_mission.rb +32 -0
  26. data/lib/warframe/rest/api/alerts.rb +23 -23
  27. data/lib/warframe/rest/api/cambion_drift.rb +23 -0
  28. data/lib/warframe/rest/api/cetus.rb +23 -0
  29. data/lib/warframe/rest/api/conclave_challenges.rb +23 -0
  30. data/lib/warframe/rest/api/global_upgrades.rb +23 -23
  31. data/lib/warframe/rest/api/invasions.rb +23 -23
  32. data/lib/warframe/rest/api/news.rb +23 -23
  33. data/lib/warframe/rest/api/nightwave.rb +23 -23
  34. data/lib/warframe/rest/api/sortie.rb +23 -0
  35. data/lib/warframe/rest/api/steel_path.rb +23 -0
  36. data/lib/warframe/rest/api/syndicate_missions.rb +23 -0
  37. data/lib/warframe/rest/api.rb +37 -25
  38. data/lib/warframe/rest/client.rb +42 -42
  39. data/lib/warframe/rest/request.rb +61 -55
  40. data/lib/warframe/rest/utils.rb +23 -19
  41. data/lib/warframe/version.rb +6 -6
  42. data/lib/warframe.rb +7 -7
  43. metadata +27 -63
@@ -0,0 +1,36 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative './base'
4
+ require_relative 'attributes/id'
5
+ require_relative 'attributes/expiry'
6
+ require_relative 'attributes/active'
7
+ require_relative 'attributes/eta'
8
+
9
+ module Warframe
10
+ module Models
11
+ # Sortie data model.
12
+ # {https://api.warframestat.us/pc/sortie /:platform/sortie}
13
+ class Sortie < Warframe::Models::Base
14
+ include Warframe::Models::Attributes::ID
15
+ include Warframe::Models::Attributes::ActiveBoth
16
+ include Warframe::Models::Attributes::Expiration
17
+ include Warframe::Models::Attributes::ETA
18
+
19
+ # The boss for this part of the sortie.
20
+ # @return [String]
21
+ attr_reader :boss
22
+
23
+ # The faction fighting you in this mission.
24
+ # @return [String]
25
+ attr_reader :faction
26
+
27
+ # Modifiers active for this challenge.
28
+ # @return [Array<OpenStruct>]
29
+ attr_reader :variants
30
+
31
+ # The reward pool which this is pulling from.
32
+ # @return [String]
33
+ attr_reader :reward_pool
34
+ end
35
+ end
36
+ end
@@ -0,0 +1,34 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative './base'
4
+
5
+ module Warframe
6
+ module Models
7
+ # SteelPath data model.
8
+ # {https://api.warframestat.us/pc/steelPath /:platform/steelPath}
9
+ class SteelPath < Warframe::Models::Base
10
+ include Warframe::Models::Attributes::Active
11
+ include Warframe::Models::Attributes::Expiry
12
+
13
+ # The currently available item from Teshin.
14
+ # @return [OpenStruct]
15
+ attr_reader :current_reward
16
+
17
+ # The time remaining of the current reward.
18
+ # @return [String]
19
+ attr_reader :remaining
20
+
21
+ # Current rotation of items the Arbiters have to offer.
22
+ # @return [Array<OpenStruct>]
23
+ attr_reader :rotation
24
+
25
+ # Current rotation of items Teshin has to offer.
26
+ # @return [Array<OpenStruct>]
27
+ attr_reader :evergreens
28
+
29
+ # Current incursion data
30
+ # @return [OpenStruct]
31
+ attr_reader :incursions
32
+ end
33
+ end
34
+ end
@@ -0,0 +1,32 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative './base'
4
+ require_relative 'attributes/eta'
5
+ require_relative 'attributes/id'
6
+ require_relative 'attributes/active'
7
+ require_relative 'attributes/start_string'
8
+
9
+ module Warframe
10
+ module Models
11
+ # SyndicateMission data model.
12
+ # {https://api.warframestat.us/pc/syndicateMissions /:platform/syndicateMissions}
13
+ class SyndicateMission < Warframe::Models::Base
14
+ include Warframe::Models::Attributes::ETA
15
+ include Warframe::Models::Attributes::ID
16
+ include Warframe::Models::Attributes::ActiveBoth
17
+ include Warframe::Models::Attributes::StartString
18
+
19
+ # 'Jobs' or challenges currently available.
20
+ # @return [Array<OpenStruct>]
21
+ attr_reader :jobs
22
+
23
+ # The syndicate you will be fighting.
24
+ # @return [String]
25
+ attr_reader :syndicate
26
+
27
+ # The nodes that this mission is available on.
28
+ # @return [Array]
29
+ attr_reader :nodes
30
+ end
31
+ end
32
+ end
@@ -1,23 +1,23 @@
1
- # frozen_string_literal: true
2
-
3
- require 'warframe/models/alert'
4
- require_relative '../utils'
5
-
6
- module Warframe
7
- module REST
8
- module API
9
- # API endpoint for getting information on current Alerts data.
10
- #
11
- # {https://api.warframestat.us/pc/alerts Example Response}
12
- module Alerts
13
- include Warframe::REST::Utils
14
-
15
- # Gets the current Alerts data.
16
- # @return [Array<[Warframe::Models::Alert]>]
17
- def alerts
18
- get('/alerts', Warframe::Models::Alert)
19
- end
20
- end
21
- end
22
- end
23
- end
1
+ # frozen_string_literal: true
2
+
3
+ require 'warframe/models/alert'
4
+ require_relative '../utils'
5
+
6
+ module Warframe
7
+ module REST
8
+ module API
9
+ # API endpoint for getting information on current Alerts data.
10
+ #
11
+ # {https://api.warframestat.us/pc/alerts Example Response}
12
+ module Alerts
13
+ include Warframe::REST::Utils
14
+
15
+ # Gets the current Alerts data.
16
+ # @return [Array<[Warframe::Models::Alert]>]
17
+ def alerts
18
+ get('/alerts', Warframe::Models::Alert)
19
+ end
20
+ end
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,23 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'warframe/models/cambion_drift'
4
+ require_relative '../utils'
5
+
6
+ module Warframe
7
+ module REST
8
+ module API
9
+ # API endpoint for getting information on current Cambion Drift data.
10
+ #
11
+ # {https://api.warframestat.us/pc/cambionDrift Example Response}
12
+ module CambionDrift
13
+ include Warframe::REST::Utils
14
+
15
+ # Gets the current cambionDrift Data.
16
+ # @return Warframe::Models::CambionDrift
17
+ def cambion_drift
18
+ get('/cambionCycle', Warframe::Models::CambionDrift)
19
+ end
20
+ end
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,23 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'warframe/models/cetus'
4
+ require_relative '../utils'
5
+
6
+ module Warframe
7
+ module REST
8
+ module API
9
+ # API endpoint for getting information on current Cetus data.
10
+ #
11
+ # {https://api.warframestat.us/pc/cetusCycle Example Response}
12
+ module Cetus
13
+ include Warframe::REST::Utils
14
+
15
+ # Gets the current cetusCycle Data.
16
+ # @return [Warframe::Models::Cetus]
17
+ def cetus
18
+ get('/cetusCycle', Warframe::Models::Cetus)
19
+ end
20
+ end
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,23 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'warframe/models/conclave_challenge'
4
+ require_relative '../utils'
5
+
6
+ module Warframe
7
+ module REST
8
+ module API
9
+ # API endpoint for getting information on current Conclave Challenge data.
10
+ #
11
+ # {https://api.warframestat.us/pc/conclaveChallenges Example Response}
12
+ module ConclaveChallenges
13
+ include Warframe::REST::Utils
14
+
15
+ # Gets the current conclave challenges.
16
+ # @return [Array<Warframe::Models::ConclaveChallenge>]
17
+ def conclave_challenges
18
+ get('/conclaveChallenges', Warframe::Models::ConclaveChallenge)
19
+ end
20
+ end
21
+ end
22
+ end
23
+ end
@@ -1,23 +1,23 @@
1
- # frozen_string_literal: true
2
-
3
- require 'warframe/models/global_upgrade'
4
- require_relative '../utils'
5
-
6
- module Warframe
7
- module REST
8
- module API
9
- # API endpoint for getting information on current Global Upgrades data.
10
- #
11
- # {https://api.warframestat.us/pc/globalUpgrades Example Response}
12
- module GlobalUpgrades
13
- include Warframe::REST::Utils
14
-
15
- # Gets the current Global Upgrades data.
16
- # @return [Array<[Warframe::Models::GlobalUpgrade]>]
17
- def global_upgrades
18
- get('/globalUpgrades', Warframe::Models::GlobalUpgrade)
19
- end
20
- end
21
- end
22
- end
23
- end
1
+ # frozen_string_literal: true
2
+
3
+ require 'warframe/models/global_upgrade'
4
+ require_relative '../utils'
5
+
6
+ module Warframe
7
+ module REST
8
+ module API
9
+ # API endpoint for getting information on current Global Upgrades data.
10
+ #
11
+ # {https://api.warframestat.us/pc/globalUpgrades Example Response}
12
+ module GlobalUpgrades
13
+ include Warframe::REST::Utils
14
+
15
+ # Gets the current Global Upgrades data.
16
+ # @return [Array<[Warframe::Models::GlobalUpgrade]>]
17
+ def global_upgrades
18
+ get('/globalUpgrades', Warframe::Models::GlobalUpgrade)
19
+ end
20
+ end
21
+ end
22
+ end
23
+ end
@@ -1,23 +1,23 @@
1
- # frozen_string_literal: true
2
-
3
- require 'warframe/models/invasion'
4
- require_relative '../utils'
5
-
6
- module Warframe
7
- module REST
8
- module API
9
- # API endpoint for getting information on current Invasions data.
10
- #
11
- # {https://api.warframestat.us/pc/invasions Example Response}
12
- module Invasions
13
- include Warframe::REST::Utils
14
-
15
- # Gets the current Invasions data.
16
- # @return [Array<[Warframe::Models::Invasion]>]
17
- def invasions
18
- get('/invasions', Warframe::Models::Invasion)
19
- end
20
- end
21
- end
22
- end
23
- end
1
+ # frozen_string_literal: true
2
+
3
+ require 'warframe/models/invasion'
4
+ require_relative '../utils'
5
+
6
+ module Warframe
7
+ module REST
8
+ module API
9
+ # API endpoint for getting information on current Invasions data.
10
+ #
11
+ # {https://api.warframestat.us/pc/invasions Example Response}
12
+ module Invasions
13
+ include Warframe::REST::Utils
14
+
15
+ # Gets the current Invasions data.
16
+ # @return [Array<[Warframe::Models::Invasion]>]
17
+ def invasions
18
+ get('/invasions', Warframe::Models::Invasion)
19
+ end
20
+ end
21
+ end
22
+ end
23
+ end
@@ -1,23 +1,23 @@
1
- # frozen_string_literal: true
2
-
3
- require 'warframe/models/news'
4
- require_relative '../utils'
5
-
6
- module Warframe
7
- module REST
8
- module API
9
- # API endpoint for getting information from the News route.
10
- #
11
- # {https://api.warframestat.us/pc/news Example Response}
12
- module News
13
- include Warframe::REST::Utils
14
-
15
- # Gets the current news data.
16
- # @return [Array<Warframe::Models::News>]
17
- def news
18
- get('/news', Warframe::Models::News)
19
- end
20
- end
21
- end
22
- end
23
- end
1
+ # frozen_string_literal: true
2
+
3
+ require 'warframe/models/news'
4
+ require_relative '../utils'
5
+
6
+ module Warframe
7
+ module REST
8
+ module API
9
+ # API endpoint for getting information from the News route.
10
+ #
11
+ # {https://api.warframestat.us/pc/news Example Response}
12
+ module News
13
+ include Warframe::REST::Utils
14
+
15
+ # Gets the current news data.
16
+ # @return [Array<Warframe::Models::News>]
17
+ def news
18
+ get('/news', Warframe::Models::News)
19
+ end
20
+ end
21
+ end
22
+ end
23
+ end
@@ -1,23 +1,23 @@
1
- # frozen_string_literal: true
2
-
3
- require 'warframe/models/nightwave'
4
- require_relative '../utils'
5
-
6
- module Warframe
7
- module REST
8
- module API
9
- # API endpoint for getting information from the Nightwave route.
10
- #
11
- # {https://api.warframestat.us/pc/nightwave Example Response}
12
- module Nightwave
13
- include Warframe::REST::Utils
14
-
15
- # Gets the current Nightwave Mission data.
16
- # @return [Warframe::Models::Nightwave]
17
- def nightwave
18
- get('/nightwave', Warframe::Models::Nightwave)
19
- end
20
- end
21
- end
22
- end
23
- end
1
+ # frozen_string_literal: true
2
+
3
+ require 'warframe/models/nightwave'
4
+ require_relative '../utils'
5
+
6
+ module Warframe
7
+ module REST
8
+ module API
9
+ # API endpoint for getting information from the Nightwave route.
10
+ #
11
+ # {https://api.warframestat.us/pc/nightwave Example Response}
12
+ module Nightwave
13
+ include Warframe::REST::Utils
14
+
15
+ # Gets the current Nightwave Mission data.
16
+ # @return [Warframe::Models::Nightwave]
17
+ def nightwave
18
+ get('/nightwave', Warframe::Models::Nightwave)
19
+ end
20
+ end
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,23 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'warframe/models/sortie'
4
+ require_relative '../utils'
5
+
6
+ module Warframe
7
+ module REST
8
+ module API
9
+ # API endpoint for getting information on current Sortie data.
10
+ #
11
+ # {https://api.warframestat.us/pc/sortie Example Response}
12
+ module Sortie
13
+ include Warframe::REST::Utils
14
+
15
+ # Gets the current sortie missions.
16
+ # @return [Array<Warframe::Models::Sortie>]
17
+ def sortie
18
+ get('/sortie', Warframe::Models::Sortie)
19
+ end
20
+ end
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,23 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'warframe/models/steel_path'
4
+ require_relative '../utils'
5
+
6
+ module Warframe
7
+ module REST
8
+ module API
9
+ # API endpoint for getting information on current SteelPath data.
10
+ #
11
+ # {https://api.warframestat.us/pc/steelPath Example Response}
12
+ module SteelPath
13
+ include Warframe::REST::Utils
14
+
15
+ # Steel Path data
16
+ # @return [Warframe::Models::SteelPath]
17
+ def steel_path
18
+ get('/steelPath', Warframe::Models::SteelPath)
19
+ end
20
+ end
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,23 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'warframe/models/syndicate_mission'
4
+ require_relative '../utils'
5
+
6
+ module Warframe
7
+ module REST
8
+ module API
9
+ # API endpoint for getting information on current SyndicateMission data.
10
+ #
11
+ # {https://api.warframestat.us/pc/syndicateMissions Example Response}
12
+ module SyndicateMissions
13
+ include Warframe::REST::Utils
14
+
15
+ # Gets the current syndicateMissions Data.
16
+ # @return [Array<Warframe::Models::SyndicateMission>]
17
+ def syndicate_missions
18
+ get('/syndicateMissions', Warframe::Models::SyndicateMission)
19
+ end
20
+ end
21
+ end
22
+ end
23
+ end
@@ -1,25 +1,37 @@
1
- # frozen_string_literal: true
2
-
3
- require_relative 'api/alerts'
4
- require_relative 'api/global_upgrades'
5
- require_relative 'api/invasions'
6
- require_relative 'api/news'
7
- require_relative 'api/nightwave'
8
-
9
- module Warframe
10
- # A REST-ful API service, provided by https://api.warframestat.us
11
- module REST
12
- # The API Router for getting live data.
13
- #
14
- # Attempting to have every accessible route from {https://docs.warframestat.us Warframe Stat}.
15
- #
16
- # Module names are 'routes' to this API. See {Warframe::REST::API::Alerts Alerts} for example.
17
- module API
18
- include Warframe::REST::API::Alerts
19
- include Warframe::REST::API::GlobalUpgrades
20
- include Warframe::REST::API::Invasions
21
- include Warframe::REST::API::News
22
- include Warframe::REST::API::Nightwave
23
- end
24
- end
25
- end
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'api/alerts'
4
+ require_relative 'api/cambion_drift'
5
+ require_relative 'api/cetus'
6
+ require_relative 'api/conclave_challenges'
7
+ require_relative 'api/global_upgrades'
8
+ require_relative 'api/invasions'
9
+ require_relative 'api/news'
10
+ require_relative 'api/nightwave'
11
+ require_relative 'api/sortie'
12
+ require_relative 'api/steel_path'
13
+ require_relative 'api/syndicate_missions'
14
+
15
+ module Warframe
16
+ # A REST-ful API service, provided by https://api.warframestat.us.
17
+ module REST
18
+ # The API Router for getting live data.
19
+ #
20
+ # Attempting to have every accessible route from {https://docs.warframestat.us Warframe Stat}.
21
+ #
22
+ # Module names are 'routes' to this API. See {Warframe::REST::API::Alerts Alerts} for example.
23
+ module API
24
+ include Warframe::REST::API::Alerts
25
+ include Warframe::REST::API::CambionDrift
26
+ include Warframe::REST::API::Cetus
27
+ include Warframe::REST::API::ConclaveChallenges
28
+ include Warframe::REST::API::GlobalUpgrades
29
+ include Warframe::REST::API::Invasions
30
+ include Warframe::REST::API::News
31
+ include Warframe::REST::API::Nightwave
32
+ include Warframe::REST::API::Sortie
33
+ include Warframe::REST::API::SteelPath
34
+ include Warframe::REST::API::SyndicateMissions
35
+ end
36
+ end
37
+ end
@@ -1,42 +1,42 @@
1
- # frozen_string_literal: true
2
-
3
- require 'warframe/client_wrapper'
4
- require_relative './api'
5
-
6
- module Warframe
7
- module REST
8
- # The main application Client for access live feed data.
9
- #
10
- # == Example Usage
11
- #
12
- # client = Warframe::REST::Client.new
13
- # client.nightwave.tag # => 'Radio Legion Intermission'
14
- #
15
- # == Accepted Platforms
16
- #
17
- # default = 'pc'
18
- # all_platorms = [ 'pc', 'ps4', 'xb1', 'swi' ]
19
- #
20
- # client = Waframe::REST::Client.new(platform: 'ps4')
21
- # client.platform # => 'ps4'
22
- # client.language # => 'en'
23
- #
24
- # == Accepted Languages
25
- #
26
- # default = 'en'
27
- # all_languages = [ 'de', 'es', 'en', 'fr', 'it', 'ko', 'pl', 'pt', 'ru', 'zh' ]
28
- #
29
- # client = Warframe::REST::Client.new(language: 'fr')
30
- # client.language # => 'fr'
31
- # client.platform # => 'pc'
32
- #
33
- # == Setting both Platform and Language
34
- #
35
- # client = Warframe::REST::Client.new(platform: 'ps4', language: 'de')
36
- # client.platform # => 'ps4'
37
- # client.language # => 'de'
38
- class Client < Warframe::ClientWrapper
39
- include Warframe::REST::API
40
- end
41
- end
42
- end
1
+ # frozen_string_literal: true
2
+
3
+ require 'warframe/client_wrapper'
4
+ require_relative './api'
5
+
6
+ module Warframe
7
+ module REST
8
+ # The main application Client for access live feed data.
9
+ #
10
+ # == Example Usage
11
+ #
12
+ # client = Warframe::REST::Client.new
13
+ # client.nightwave.tag # => 'Radio Legion Intermission'
14
+ #
15
+ # == Accepted Platforms
16
+ #
17
+ # default = 'pc'
18
+ # all_platorms = [ 'pc', 'ps4', 'xb1', 'swi' ]
19
+ #
20
+ # client = Waframe::REST::Client.new(platform: 'ps4')
21
+ # client.platform # => 'ps4'
22
+ # client.language # => 'en'
23
+ #
24
+ # == Accepted Languages
25
+ #
26
+ # default = 'en'
27
+ # all_languages = [ 'de', 'es', 'en', 'fr', 'it', 'ko', 'pl', 'pt', 'ru', 'zh' ]
28
+ #
29
+ # client = Warframe::REST::Client.new(language: 'fr')
30
+ # client.language # => 'fr'
31
+ # client.platform # => 'pc'
32
+ #
33
+ # == Setting both Platform and Language
34
+ #
35
+ # client = Warframe::REST::Client.new(platform: 'ps4', language: 'de')
36
+ # client.platform # => 'ps4'
37
+ # client.language # => 'de'
38
+ class Client < Warframe::ClientWrapper
39
+ include Warframe::REST::API
40
+ end
41
+ end
42
+ end