zombie_battleground-api 0.7.0 → 0.7.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.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +1 -1
- data/lib/zombie_battleground/api/extensions/matches.rb +1 -13
- data/lib/zombie_battleground/api/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3f9ccf27c8858a8d641228a4560dc535c472648f8db49de60960f4602a84095b
|
4
|
+
data.tar.gz: 773501da406f8b018652e04b5373a4318aeecd583dc6012bb664b0cbe6b3dc2d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c47bdffaee27fedb0e0fb92fb4ddc3d09eb5e8c5200f520051df14ecf2764871e41d178744401472be5475b3bc0fbdd12f765ed396dcaabd2f7e945992be8b78
|
7
|
+
data.tar.gz: 2cd08e78cfa81240172b0fe2eb380ba5d5f7788913146b821a5a7bbe9cbf03c45529523147acdbfe1a583f08543829e02064c63cd3e4b31956412b3cf53e6459
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -26,7 +26,7 @@ Or install it yourself as:
|
|
26
26
|
|
27
27
|
## Usage
|
28
28
|
|
29
|
-
See the [API documentation](https://www.rubydoc.info/gems/zombie_battleground-api/0.7.
|
29
|
+
See the [API documentation](https://www.rubydoc.info/gems/zombie_battleground-api/0.7.1).
|
30
30
|
Every API call returns a response object that contains a complete modeled Ruby object of the response.
|
31
31
|
|
32
32
|
Use the singleton class `ZombieBattleground::Api`. The singleton has additional extentions, the client implements the public API as is.
|
@@ -64,12 +64,9 @@ module ZombieBattleground
|
|
64
64
|
#
|
65
65
|
# @api public
|
66
66
|
def recently_created_matches(limit)
|
67
|
-
# the `.sort` calls are dodging coverage?...
|
68
|
-
# :nocov:
|
69
67
|
all_matches.to_a
|
70
68
|
.sort { |a, b| b.created_at <=> a.created_at }
|
71
69
|
.first(limit)
|
72
|
-
# :nocov:
|
73
70
|
end
|
74
71
|
|
75
72
|
##
|
@@ -85,12 +82,9 @@ module ZombieBattleground
|
|
85
82
|
#
|
86
83
|
# @api public
|
87
84
|
def recently_updated_matches(limit)
|
88
|
-
# the `.sort` calls are dodging coverage?...
|
89
|
-
# :nocov:
|
90
85
|
all_matches.to_a
|
91
86
|
.sort { |a, b| b.updated_at <=> a.updated_at }
|
92
87
|
.first(limit)
|
93
|
-
# :nocov:
|
94
88
|
end
|
95
89
|
|
96
90
|
##
|
@@ -106,13 +100,10 @@ module ZombieBattleground
|
|
106
100
|
#
|
107
101
|
# @api public
|
108
102
|
def recently_ended_matches(limit)
|
109
|
-
# the `.sort` calls are dodging coverage?...
|
110
|
-
# :nocov:
|
111
103
|
all_matches.to_a
|
112
104
|
.select { |match| match.status == 'Ended' }
|
113
|
-
.sort { |a, b| b.
|
105
|
+
.sort { |a, b| b.updated_at <=> a.updated_at }
|
114
106
|
.first(limit)
|
115
|
-
# :nocov:
|
116
107
|
end
|
117
108
|
|
118
109
|
##
|
@@ -128,14 +119,11 @@ module ZombieBattleground
|
|
128
119
|
#
|
129
120
|
# @api public
|
130
121
|
def matches_for_player(player_id)
|
131
|
-
# the `.sort` calls are dodging coverage?...
|
132
|
-
# :nocov:
|
133
122
|
all_matches(player1_id: player_id)
|
134
123
|
.to_a
|
135
124
|
.push(*all_matches(player2_id: player_id).to_a)
|
136
125
|
.uniq(&:id)
|
137
126
|
.sort { |a, b| b.created_at <=> a.created_at }
|
138
|
-
# :nocov:
|
139
127
|
end
|
140
128
|
end
|
141
129
|
end
|