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