warframe 0.3.0 → 0.3.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (43) hide show
  1. checksums.yaml +4 -4
  2. data/.yardopts +3 -3
  3. data/README.md +99 -93
  4. data/lib/warframe/cache.rb +37 -37
  5. data/lib/warframe/client_wrapper.rb +39 -39
  6. data/lib/warframe/models/alert.rb +30 -30
  7. data/lib/warframe/models/attributes/active.rb +31 -31
  8. data/lib/warframe/models/attributes/description.rb +21 -21
  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 -26
  17. data/lib/warframe/models/cetus.rb +40 -40
  18. data/lib/warframe/models/conclave_challenge.rb +54 -54
  19. data/lib/warframe/models/global_upgrade.rb +41 -41
  20. data/lib/warframe/models/invasion.rb +71 -71
  21. data/lib/warframe/models/news.rb +54 -54
  22. data/lib/warframe/models/nightwave.rb +40 -40
  23. data/lib/warframe/models/sortie.rb +36 -36
  24. data/lib/warframe/models/steel_path.rb +34 -34
  25. data/lib/warframe/models/syndicate_mission.rb +32 -32
  26. data/lib/warframe/rest/api/alerts.rb +23 -23
  27. data/lib/warframe/rest/api/cambion_drift.rb +23 -23
  28. data/lib/warframe/rest/api/cetus.rb +23 -23
  29. data/lib/warframe/rest/api/conclave_challenges.rb +23 -23
  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 -23
  35. data/lib/warframe/rest/api/steel_path.rb +23 -23
  36. data/lib/warframe/rest/api/syndicate_missions.rb +23 -23
  37. data/lib/warframe/rest/api.rb +37 -37
  38. data/lib/warframe/rest/client.rb +42 -42
  39. data/lib/warframe/rest/request.rb +61 -61
  40. data/lib/warframe/rest/utils.rb +23 -23
  41. data/lib/warframe/version.rb +6 -6
  42. data/lib/warframe.rb +7 -7
  43. metadata +14 -43
@@ -1,14 +1,14 @@
1
- # frozen_string_literal: true
2
-
3
- module Warframe
4
- module Models
5
- module Attributes
6
- # The types of rewards you can get from this event.
7
- module RewardTypes
8
- # The types of rewards you can get from this event.
9
- # @return [Array<String>]
10
- attr_reader :reward_types
11
- end
12
- end
13
- end
14
- end
1
+ # frozen_string_literal: true
2
+
3
+ module Warframe
4
+ module Models
5
+ module Attributes
6
+ # The types of rewards you can get from this event.
7
+ module RewardTypes
8
+ # The types of rewards you can get from this event.
9
+ # @return [Array<String>]
10
+ attr_reader :reward_types
11
+ end
12
+ end
13
+ end
14
+ end
@@ -1,14 +1,14 @@
1
- # frozen_string_literal: true
2
-
3
- module Warframe
4
- module Models
5
- module Attributes
6
- # Adds the start_string attribute, for when an event will begin.
7
- module StartString
8
- # When this event goes into effect.
9
- # @return [String]
10
- attr_reader :start_string
11
- end
12
- end
13
- end
14
- end
1
+ # frozen_string_literal: true
2
+
3
+ module Warframe
4
+ module Models
5
+ module Attributes
6
+ # Adds the start_string attribute, for when an event will begin.
7
+ module StartString
8
+ # When this event goes into effect.
9
+ # @return [String]
10
+ attr_reader :start_string
11
+ end
12
+ end
13
+ end
14
+ end
@@ -1,18 +1,18 @@
1
- # frozen_string_literal: true
2
-
3
- module Warframe
4
- module Models
5
- module Attributes
6
- # Includes the translations attribute.
7
- module Translations
8
- # The message that can be translated.
9
- # @return [String]
10
- attr_reader :message
11
-
12
- # Available translations for the requested data.
13
- # @return [OpenStruct]
14
- attr_reader :translations
15
- end
16
- end
17
- end
18
- end
1
+ # frozen_string_literal: true
2
+
3
+ module Warframe
4
+ module Models
5
+ module Attributes
6
+ # Includes the translations attribute.
7
+ module Translations
8
+ # The message that can be translated.
9
+ # @return [String]
10
+ attr_reader :message
11
+
12
+ # Available translations for the requested data.
13
+ # @return [OpenStruct]
14
+ attr_reader :translations
15
+ end
16
+ end
17
+ end
18
+ end
@@ -1,36 +1,36 @@
1
- # frozen_string_literal: true
2
-
3
- require 'fast_underscore'
4
-
5
- module Warframe
6
- # Models of HTTP responses.
7
- module Models
8
- # Warframe Base Model.
9
- class Base
10
- attr_reader :error, :code
11
-
12
- # Creates a new [Warframe::Models::Base] instance.
13
- # @param options [Hash, Array] a parsed JSON object, or collection of JSON objects.
14
- def initialize(options = {})
15
- if options.is_a? Array
16
- from_array options
17
- else
18
- options.each do |k, v|
19
- renamed = k.to_s.underscore
20
- v = v.map { |obj| OpenStruct.new obj } if v.is_a?(Array) && v[0].is_a?(Hash)
21
- v = OpenStruct.new v if v.is_a? Hash
22
- instance_variable_set "@#{renamed}", v
23
- end
24
- end
25
- end
26
-
27
- private
28
-
29
- # Constructs an Array of new [Warframe::Models::Base]'s'.
30
- # @return [Array]
31
- def from_array(arr)
32
- arr.map { |obj| initialize obj }
33
- end
34
- end
35
- end
36
- end
1
+ # frozen_string_literal: true
2
+
3
+ require 'fast_underscore'
4
+
5
+ module Warframe
6
+ # Models of HTTP responses.
7
+ module Models
8
+ # Warframe Base Model.
9
+ class Base
10
+ attr_reader :error, :code
11
+
12
+ # Creates a new [Warframe::Models::Base] instance.
13
+ # @param options [Hash, Array] a parsed JSON object, or collection of JSON objects.
14
+ def initialize(options = {})
15
+ if options.is_a? Array
16
+ from_array options
17
+ else
18
+ options.each do |k, v|
19
+ renamed = k.to_s.underscore
20
+ v = v.map { |obj| OpenStruct.new obj } if v.is_a?(Array) && v[0].is_a?(Hash)
21
+ v = OpenStruct.new v if v.is_a? Hash
22
+ instance_variable_set "@#{renamed}", v
23
+ end
24
+ end
25
+ end
26
+
27
+ private
28
+
29
+ # Constructs an Array of new [Warframe::Models::Base]'s'.
30
+ # @return [Array]
31
+ def from_array(arr)
32
+ arr.map { |obj| initialize obj }
33
+ end
34
+ end
35
+ end
36
+ end
@@ -1,26 +1,26 @@
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
-
8
- module Warframe
9
- module Models
10
- # Cambion Drift data model.
11
- # {https://api.warframestat.us/pc/cambionCycle /:platform/cambionCycle}
12
- class CambionDrift < Warframe::Models::Base
13
- include Warframe::Models::Attributes::ID
14
- include Warframe::Models::Attributes::Activation
15
- include Warframe::Models::Attributes::Expiry
16
-
17
- # Current active state of the world, either 'vome' or 'fass'.
18
- # @return [String]
19
- attr_reader :active
20
-
21
- # The time remaining until world state switches.
22
- # @return [String]
23
- attr_reader :time_left
24
- end
25
- end
26
- end
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
+
8
+ module Warframe
9
+ module Models
10
+ # Cambion Drift data model.
11
+ # {https://api.warframestat.us/pc/cambionCycle /:platform/cambionCycle}
12
+ class CambionDrift < Warframe::Models::Base
13
+ include Warframe::Models::Attributes::ID
14
+ include Warframe::Models::Attributes::Activation
15
+ include Warframe::Models::Attributes::Expiry
16
+
17
+ # Current active state of the world, either 'vome' or 'fass'.
18
+ # @return [String]
19
+ attr_reader :active
20
+
21
+ # The time remaining until world state switches.
22
+ # @return [String]
23
+ attr_reader :time_left
24
+ end
25
+ end
26
+ end
@@ -1,40 +1,40 @@
1
- # frozen_string_literal: true
2
-
3
- require_relative './base'
4
- require_relative 'attributes/id'
5
- require_relative 'attributes/active'
6
- require_relative 'attributes/expiry'
7
-
8
- module Warframe
9
- module Models
10
- # Cetus data model.
11
- # {https://api.warframestat.us/pc/cetusCycle /:platform/cetusCycle}
12
- class Cetus < Warframe::Models::Base
13
- include Warframe::Models::Attributes::ID
14
- include Warframe::Models::Attributes::Activation
15
- include Warframe::Models::Attributes::Expiry
16
-
17
- # Whether or not it is currently day.
18
- # @return [Boolean]
19
- attr_reader :is_day
20
- alias day? is_day
21
-
22
- # Current world state of Cetus.
23
- # @return [String]
24
- attr_reader :state
25
-
26
- # Whether or not this is Cetus.
27
- # @return [Boolean]
28
- attr_reader :is_cetus
29
- alias cetus? is_cetus
30
-
31
- # Time left until state change.
32
- # @return [String]
33
- attr_reader :time_left
34
-
35
- # A short string of the time left until state change.
36
- # @return [String]
37
- attr_reader :short_string
38
- end
39
- end
40
- end
1
+ # frozen_string_literal: true
2
+
3
+ require_relative './base'
4
+ require_relative 'attributes/id'
5
+ require_relative 'attributes/active'
6
+ require_relative 'attributes/expiry'
7
+
8
+ module Warframe
9
+ module Models
10
+ # Cetus data model.
11
+ # {https://api.warframestat.us/pc/cetusCycle /:platform/cetusCycle}
12
+ class Cetus < Warframe::Models::Base
13
+ include Warframe::Models::Attributes::ID
14
+ include Warframe::Models::Attributes::Activation
15
+ include Warframe::Models::Attributes::Expiry
16
+
17
+ # Whether or not it is currently day.
18
+ # @return [Boolean]
19
+ attr_reader :is_day
20
+ alias day? is_day
21
+
22
+ # Current world state of Cetus.
23
+ # @return [String]
24
+ attr_reader :state
25
+
26
+ # Whether or not this is Cetus.
27
+ # @return [Boolean]
28
+ attr_reader :is_cetus
29
+ alias cetus? is_cetus
30
+
31
+ # Time left until state change.
32
+ # @return [String]
33
+ attr_reader :time_left
34
+
35
+ # A short string of the time left until state change.
36
+ # @return [String]
37
+ attr_reader :short_string
38
+ end
39
+ end
40
+ end
@@ -1,54 +1,54 @@
1
- # frozen_string_literal: true
2
-
3
- require_relative './base'
4
- require_relative 'attributes/expiry'
5
- require_relative 'attributes/eta'
6
- require_relative 'attributes/description'
7
- require_relative 'attributes/id'
8
- require_relative 'attributes/active'
9
-
10
- module Warframe
11
- module Models
12
- # Conclave Challenges data model.
13
- # {https://api.warframestat.us/pc/conclaveChallenges /:platform/conclaveChallenges}
14
- class ConclaveChallenge < Warframe::Models::Base
15
- include Warframe::Models::Attributes::Expiration
16
- include Warframe::Models::Attributes::ETA
17
- include Warframe::Models::Attributes::Description
18
- include Warframe::Models::Attributes::ID
19
- include Warframe::Models::Attributes::Activation
20
-
21
- # The mode of the conclave.
22
- # @return [String]
23
- attr_reader :mode
24
-
25
- # The amount of challenges that must be completed.
26
- # @return [Integer]
27
- attr_reader :amount
28
-
29
- # The amount of standing you will gain upon completion.
30
- # @return [Integer]
31
- attr_reader :standing
32
-
33
- # The title of the challenge.
34
- # @return [String]
35
- attr_reader :title
36
-
37
- # The category of mission, usually 'weekly' / 'daily'.
38
- # @return [String]
39
- attr_reader :category
40
-
41
- # Whether or not this is a daily mission.
42
- # @return [Boolean]
43
- attr_reader :daily
44
-
45
- # The challenge information in a one line string.
46
- # @return [String]
47
- attr_reader :as_string
48
-
49
- # Whether or not this is a root challenge.
50
- # @return [Boolean]
51
- attr_reader :root_challenge
52
- end
53
- end
54
- end
1
+ # frozen_string_literal: true
2
+
3
+ require_relative './base'
4
+ require_relative 'attributes/expiry'
5
+ require_relative 'attributes/eta'
6
+ require_relative 'attributes/description'
7
+ require_relative 'attributes/id'
8
+ require_relative 'attributes/active'
9
+
10
+ module Warframe
11
+ module Models
12
+ # Conclave Challenges data model.
13
+ # {https://api.warframestat.us/pc/conclaveChallenges /:platform/conclaveChallenges}
14
+ class ConclaveChallenge < Warframe::Models::Base
15
+ include Warframe::Models::Attributes::Expiration
16
+ include Warframe::Models::Attributes::ETA
17
+ include Warframe::Models::Attributes::Description
18
+ include Warframe::Models::Attributes::ID
19
+ include Warframe::Models::Attributes::Activation
20
+
21
+ # The mode of the conclave.
22
+ # @return [String]
23
+ attr_reader :mode
24
+
25
+ # The amount of challenges that must be completed.
26
+ # @return [Integer]
27
+ attr_reader :amount
28
+
29
+ # The amount of standing you will gain upon completion.
30
+ # @return [Integer]
31
+ attr_reader :standing
32
+
33
+ # The title of the challenge.
34
+ # @return [String]
35
+ attr_reader :title
36
+
37
+ # The category of mission, usually 'weekly' / 'daily'.
38
+ # @return [String]
39
+ attr_reader :category
40
+
41
+ # Whether or not this is a daily mission.
42
+ # @return [Boolean]
43
+ attr_reader :daily
44
+
45
+ # The challenge information in a one line string.
46
+ # @return [String]
47
+ attr_reader :as_string
48
+
49
+ # Whether or not this is a root challenge.
50
+ # @return [Boolean]
51
+ attr_reader :root_challenge
52
+ end
53
+ end
54
+ end
@@ -1,41 +1,41 @@
1
- # frozen_string_literal: true
2
-
3
- require_relative './attributes/expiry'
4
- require_relative './attributes/description'
5
- require_relative './attributes/eta'
6
-
7
- module Warframe
8
- module Models
9
- # Global Upgrades data model.
10
- # {https://api.warframestat.us/pc/globalUpgrades /:platform/globalUpgrades}
11
- class GlobalUpgrade < Warframe::Models::Base
12
- include Warframe::Models::Attributes::Expired
13
- include Warframe::Models::Attributes::Desc
14
- include Warframe::Models::Attributes::ETA
15
-
16
- # The start of the global upgrade.
17
- # @return [String]
18
- attr_reader :start
19
-
20
- # The end of the global upgrade.
21
- # @return [String]
22
- attr_reader :end
23
-
24
- # The upgrade to be received.
25
- # @return [String]
26
- attr_reader :upgrade
27
-
28
- # The operation of the global upgrade.
29
- # @return [String]
30
- attr_reader :operation
31
-
32
- # The symbol of the operation.
33
- # @return [String]
34
- attr_reader :operation_symbol
35
-
36
- # The upgrade operation value.
37
- # @return [Integer]
38
- attr_reader :upgrade_operation_value
39
- end
40
- end
41
- end
1
+ # frozen_string_literal: true
2
+
3
+ require_relative './attributes/expiry'
4
+ require_relative './attributes/description'
5
+ require_relative './attributes/eta'
6
+
7
+ module Warframe
8
+ module Models
9
+ # Global Upgrades data model.
10
+ # {https://api.warframestat.us/pc/globalUpgrades /:platform/globalUpgrades}
11
+ class GlobalUpgrade < Warframe::Models::Base
12
+ include Warframe::Models::Attributes::Expired
13
+ include Warframe::Models::Attributes::Desc
14
+ include Warframe::Models::Attributes::ETA
15
+
16
+ # The start of the global upgrade.
17
+ # @return [String]
18
+ attr_reader :start
19
+
20
+ # The end of the global upgrade.
21
+ # @return [String]
22
+ attr_reader :end
23
+
24
+ # The upgrade to be received.
25
+ # @return [String]
26
+ attr_reader :upgrade
27
+
28
+ # The operation of the global upgrade.
29
+ # @return [String]
30
+ attr_reader :operation
31
+
32
+ # The symbol of the operation.
33
+ # @return [String]
34
+ attr_reader :operation_symbol
35
+
36
+ # The upgrade operation value.
37
+ # @return [Integer]
38
+ attr_reader :upgrade_operation_value
39
+ end
40
+ end
41
+ end
@@ -1,71 +1,71 @@
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
- require_relative './attributes/description'
9
- require_relative './attributes/reward_types'
10
- require_relative './attributes/start_string'
11
-
12
- module Warframe
13
- module Models
14
- # Invasion data model.
15
- # {https://api.warframestat.us/pc/invasions /:platform/invasions}
16
- class Invasion < Warframe::Models::Base
17
- include Warframe::Models::Attributes::ID
18
- include Warframe::Models::Attributes::Activation
19
- include Warframe::Models::Attributes::Expiry
20
- include Warframe::Models::Attributes::ETA
21
- include Warframe::Models::Attributes::Description
22
- include Warframe::Models::Attributes::RewardTypes
23
- include Warframe::Models::Attributes::StartString
24
-
25
- # Attacking faction data.
26
- # @return [OpenStruct]
27
- attr_reader :attacker
28
-
29
- # The rewards for helping the attacking faction.
30
- # @return [OpenStruct]
31
- attr_reader :attacker_reward
32
-
33
- # Attacking Faction Name
34
- # @return [String]
35
- attr_reader :attacking_faction
36
-
37
- # Whether or not the invasion has been completed.
38
- # @return [Boolean]
39
- attr_reader :completed
40
- alias completed? completed
41
-
42
- # The status of completion of the invasion.
43
- # @return [Array<Float>]
44
- attr_reader :completion
45
-
46
- # Defending faction data.
47
- # @return [OpenStruct]
48
- attr_reader :defender
49
-
50
- # The rewards for helping the defending faction.
51
- # @return [OpenStruct]
52
- attr_reader :defender_reward
53
-
54
- # The name of the defending faction.
55
- # @return [String]
56
- attr_reader :defending_faction
57
-
58
- # The name of the node of the invasion.
59
- # @return [String]
60
- attr_reader :node
61
-
62
- # The key of the node.
63
- # @return [String]
64
- attr_reader :node_key
65
-
66
- # The amount of runs required for completion.
67
- # @return [Integer]
68
- attr_reader :required_runs
69
- end
70
- end
71
- end
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
+ require_relative './attributes/description'
9
+ require_relative './attributes/reward_types'
10
+ require_relative './attributes/start_string'
11
+
12
+ module Warframe
13
+ module Models
14
+ # Invasion data model.
15
+ # {https://api.warframestat.us/pc/invasions /:platform/invasions}
16
+ class Invasion < Warframe::Models::Base
17
+ include Warframe::Models::Attributes::ID
18
+ include Warframe::Models::Attributes::Activation
19
+ include Warframe::Models::Attributes::Expiry
20
+ include Warframe::Models::Attributes::ETA
21
+ include Warframe::Models::Attributes::Description
22
+ include Warframe::Models::Attributes::RewardTypes
23
+ include Warframe::Models::Attributes::StartString
24
+
25
+ # Attacking faction data.
26
+ # @return [OpenStruct]
27
+ attr_reader :attacker
28
+
29
+ # The rewards for helping the attacking faction.
30
+ # @return [OpenStruct]
31
+ attr_reader :attacker_reward
32
+
33
+ # Attacking Faction Name
34
+ # @return [String]
35
+ attr_reader :attacking_faction
36
+
37
+ # Whether or not the invasion has been completed.
38
+ # @return [Boolean]
39
+ attr_reader :completed
40
+ alias completed? completed
41
+
42
+ # The status of completion of the invasion.
43
+ # @return [Array<Float>]
44
+ attr_reader :completion
45
+
46
+ # Defending faction data.
47
+ # @return [OpenStruct]
48
+ attr_reader :defender
49
+
50
+ # The rewards for helping the defending faction.
51
+ # @return [OpenStruct]
52
+ attr_reader :defender_reward
53
+
54
+ # The name of the defending faction.
55
+ # @return [String]
56
+ attr_reader :defending_faction
57
+
58
+ # The name of the node of the invasion.
59
+ # @return [String]
60
+ attr_reader :node
61
+
62
+ # The key of the node.
63
+ # @return [String]
64
+ attr_reader :node_key
65
+
66
+ # The amount of runs required for completion.
67
+ # @return [Integer]
68
+ attr_reader :required_runs
69
+ end
70
+ end
71
+ end