zombie_battleground-api 0.2.1 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +24 -1
- data/README.md +17 -5
- data/lib/zombie_battleground/api/client.rb +32 -19
- data/lib/zombie_battleground/api/requests/get_deck_request.rb +1 -1
- data/lib/zombie_battleground/api/version.rb +1 -1
- data/lib/zombie_battleground/api.rb +148 -23
- data/zombie_battleground-api.gemspec +2 -0
- metadata +30 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 34fc43e2507e55e1951d7129ce11c504c7e27062a6c0c2157dcc5d05a9519ebe
|
4
|
+
data.tar.gz: '0835fc5e45bb4e62520f3e3a6cee2f26af62f240c0d525145855b2cbe20a2617'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d8a1ee09f560723cf30110e2db8bde35e6aca2d0f9eae438e457d6f7a0c0706cb3c716bba18731f77403e1da2d05cf5c24dc2793535081f4eb11770f4adef30d
|
7
|
+
data.tar.gz: bf055508b468c05c5310af9c3037faed74695beb7fd84e98bf65d2f7cb3d42dc96bd0df1c84e10b0339428287a006ccb5873902bd2cb141dac0a552000b37e9b
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
zombie_battleground-api (0.
|
4
|
+
zombie_battleground-api (0.3.0)
|
5
5
|
activerecord
|
6
6
|
faraday
|
7
7
|
json
|
@@ -22,15 +22,26 @@ GEM
|
|
22
22
|
i18n (>= 0.7, < 2)
|
23
23
|
minitest (~> 5.1)
|
24
24
|
tzinfo (~> 1.1)
|
25
|
+
addressable (2.6.0)
|
26
|
+
public_suffix (>= 2.0.2, < 4.0)
|
25
27
|
arel (9.0.0)
|
26
28
|
ast (2.4.0)
|
27
29
|
coderay (1.1.2)
|
28
30
|
concurrent-ruby (1.1.4)
|
31
|
+
coveralls (0.8.22)
|
32
|
+
json (>= 1.8, < 3)
|
33
|
+
simplecov (~> 0.16.1)
|
34
|
+
term-ansicolor (~> 1.3)
|
35
|
+
thor (~> 0.19.4)
|
36
|
+
tins (~> 1.6)
|
37
|
+
crack (0.4.3)
|
38
|
+
safe_yaml (~> 1.0.0)
|
29
39
|
diff-lcs (1.3)
|
30
40
|
docile (1.3.1)
|
31
41
|
faraday (0.15.4)
|
32
42
|
multipart-post (>= 1.2, < 3)
|
33
43
|
gem-release (2.0.1)
|
44
|
+
hashdiff (0.3.8)
|
34
45
|
i18n (1.5.3)
|
35
46
|
concurrent-ruby (~> 1.0)
|
36
47
|
jaro_winkler (1.5.1)
|
@@ -48,6 +59,7 @@ GEM
|
|
48
59
|
pry-doc (1.0.0)
|
49
60
|
pry (~> 0.11)
|
50
61
|
yard (~> 0.9.11)
|
62
|
+
public_suffix (3.0.3)
|
51
63
|
rainbow (3.0.0)
|
52
64
|
rake (10.5.0)
|
53
65
|
rspec (3.8.0)
|
@@ -72,15 +84,24 @@ GEM
|
|
72
84
|
ruby-progressbar (~> 1.7)
|
73
85
|
unicode-display_width (~> 1.0, >= 1.0.1)
|
74
86
|
ruby-progressbar (1.9.0)
|
87
|
+
safe_yaml (1.0.4)
|
75
88
|
simplecov (0.16.1)
|
76
89
|
docile (~> 1.1)
|
77
90
|
json (>= 1.8, < 3)
|
78
91
|
simplecov-html (~> 0.10.0)
|
79
92
|
simplecov-html (0.10.2)
|
93
|
+
term-ansicolor (1.7.1)
|
94
|
+
tins (~> 1.0)
|
95
|
+
thor (0.19.4)
|
80
96
|
thread_safe (0.3.6)
|
97
|
+
tins (1.20.2)
|
81
98
|
tzinfo (1.2.5)
|
82
99
|
thread_safe (~> 0.1)
|
83
100
|
unicode-display_width (1.4.0)
|
101
|
+
webmock (3.5.1)
|
102
|
+
addressable (>= 2.3.6)
|
103
|
+
crack (>= 0.3.2)
|
104
|
+
hashdiff
|
84
105
|
yard (0.9.18)
|
85
106
|
yardstick (0.9.9)
|
86
107
|
yard (~> 0.8, >= 0.8.7.2)
|
@@ -90,11 +111,13 @@ PLATFORMS
|
|
90
111
|
|
91
112
|
DEPENDENCIES
|
92
113
|
bundler (~> 1.16)
|
114
|
+
coveralls
|
93
115
|
gem-release
|
94
116
|
rake (~> 10.0)
|
95
117
|
rspec (~> 3.0)
|
96
118
|
rubocop
|
97
119
|
simplecov
|
120
|
+
webmock
|
98
121
|
yard
|
99
122
|
yardstick
|
100
123
|
zombie_battleground-api!
|
data/README.md
CHANGED
@@ -1,5 +1,9 @@
|
|
1
1
|
# ZombieBattleground::Api
|
2
2
|
|
3
|
+
[![Gem Version](https://badge.fury.io/rb/zombie_battleground-api.svg)](https://badge.fury.io/rb/zombie_battleground-api)
|
4
|
+
[![Build Status](https://travis-ci.org/watmin/zombie_battleground-api.svg?branch=master)](https://travis-ci.org/watmin/zombie_battleground-api)
|
5
|
+
[![Coverage Status](https://coveralls.io/repos/github/watmin/zombie_battleground-api/badge.svg?branch=master)](https://coveralls.io/github/watmin/zombie_battleground-api?branch=master)
|
6
|
+
|
3
7
|
Ruby implementation of the Public API for Zombie Battleground
|
4
8
|
|
5
9
|
## Installation
|
@@ -20,25 +24,33 @@ Or install it yourself as:
|
|
20
24
|
|
21
25
|
## Usage
|
22
26
|
|
23
|
-
See the [API documentation](https://www.rubydoc.info/gems/zombie_battleground-api).
|
27
|
+
See the [API documentation](https://www.rubydoc.info/gems/zombie_battleground-api/0.3.0).
|
24
28
|
Every API call returns a response object that contains a complete modeled Ruby object of the response.
|
25
29
|
|
26
30
|
Use the singleton class `ZombieBattleground::Api`
|
27
31
|
|
28
32
|
```ruby
|
29
|
-
require 'zombie_battleground
|
33
|
+
require 'zombie_battleground/api'
|
30
34
|
|
31
|
-
ZombieBattleground::Api.
|
35
|
+
ZombieBattleground::Api.decks_request(limit: 1)
|
32
36
|
# => ZombieBattleground::Api::Responses::GetDecksResponse
|
37
|
+
|
38
|
+
ZombieBattleground::Api.decks(limit: 1)
|
39
|
+
# => [ZombieBattleground::Api::Models::Decks]
|
33
40
|
```
|
34
41
|
|
35
42
|
Use the API client directly
|
36
43
|
|
37
44
|
```ruby
|
38
|
-
require 'zombie_battleground
|
45
|
+
require 'zombie_battleground/api/client'
|
39
46
|
|
40
47
|
client = ZombieBattleground::Api::Client.new
|
41
|
-
|
48
|
+
|
49
|
+
client.decks_request(limit: 1)
|
50
|
+
# => ZombieBattleground::Api::Responses::GetDecksResponse
|
51
|
+
|
52
|
+
client.decks(limit: 1)
|
53
|
+
# => [ZombieBattleground::Api::Models::Decks]
|
42
54
|
```
|
43
55
|
|
44
56
|
## Development
|
@@ -3,17 +3,29 @@
|
|
3
3
|
require 'faraday'
|
4
4
|
|
5
5
|
require 'zombie_battleground/api/errors'
|
6
|
+
require 'zombie_battleground/api/version'
|
6
7
|
|
8
|
+
# decks
|
7
9
|
require 'zombie_battleground/api/requests/get_decks_request'
|
8
10
|
require 'zombie_battleground/api/responses/get_decks_response'
|
11
|
+
|
12
|
+
# deck
|
9
13
|
require 'zombie_battleground/api/requests/get_deck_request'
|
10
14
|
require 'zombie_battleground/api/responses/get_deck_response'
|
15
|
+
|
16
|
+
# matches
|
11
17
|
require 'zombie_battleground/api/requests/get_matches_request'
|
12
18
|
require 'zombie_battleground/api/responses/get_matches_response'
|
19
|
+
|
20
|
+
# match
|
13
21
|
require 'zombie_battleground/api/requests/get_match_request'
|
14
22
|
require 'zombie_battleground/api/responses/get_match_response'
|
23
|
+
|
24
|
+
# cards
|
15
25
|
require 'zombie_battleground/api/requests/get_cards_request'
|
16
26
|
require 'zombie_battleground/api/responses/get_cards_response'
|
27
|
+
|
28
|
+
# card
|
17
29
|
require 'zombie_battleground/api/requests/get_card_request'
|
18
30
|
require 'zombie_battleground/api/responses/get_card_response'
|
19
31
|
|
@@ -25,10 +37,11 @@ module ZombieBattleground
|
|
25
37
|
##
|
26
38
|
# Creates a new client
|
27
39
|
#
|
28
|
-
# @return [
|
40
|
+
# @return [ZombieBattleground::Api::Client]
|
29
41
|
#
|
30
42
|
# @example
|
31
43
|
# client = ZombieBattleground::Api::Client.new
|
44
|
+
# # => ZombieBattleground::Api::Client
|
32
45
|
#
|
33
46
|
# @api public
|
34
47
|
def initialize
|
@@ -55,11 +68,11 @@ module ZombieBattleground
|
|
55
68
|
# @raise [ZombieBattleground::Api::Errors::InvalidInput, ZombieBattleground::Api::Errors::InvalidResponse]
|
56
69
|
#
|
57
70
|
# @example
|
58
|
-
# response = client.
|
59
|
-
#
|
71
|
+
# response = client.decks_reuest(limit: 1)
|
72
|
+
# # => ZombieBattleground::Api::Responses::GetDecksResponse
|
60
73
|
#
|
61
74
|
# @api public
|
62
|
-
def
|
75
|
+
def decks_request(**args)
|
63
76
|
request = ZombieBattleground::Api::Requests::GetDecksRequest.new
|
64
77
|
args.each { |key, val| request.send("#{key}=", val) }
|
65
78
|
raise ZombieBattleground::Api::Errors::InvalidInput, request.errors.messages unless request.valid?
|
@@ -81,11 +94,11 @@ module ZombieBattleground
|
|
81
94
|
# @raise [ZombieBattleground::Api::Errors::InvalidInput, ZombieBattleground::Api::Errors::InvalidResponse]
|
82
95
|
#
|
83
96
|
# @example
|
84
|
-
# response = client.
|
85
|
-
#
|
97
|
+
# response = client.deck_request(id: 1813)
|
98
|
+
# # => ZombieBattleground::Api::Responses::GetDeckResponse
|
86
99
|
#
|
87
100
|
# @api public
|
88
|
-
def
|
101
|
+
def deck_request(**args)
|
89
102
|
request = ZombieBattleground::Api::Requests::GetDeckRequest.new
|
90
103
|
args.each { |key, val| request.send("#{key}=", val) }
|
91
104
|
raise ZombieBattleground::Api::Errors::InvalidInput, request.errors.messages unless request.valid?
|
@@ -114,11 +127,11 @@ module ZombieBattleground
|
|
114
127
|
# @raise [ZombieBattleground::Api::Errors::InvalidInput, ZombieBattleground::Api::Errors::InvalidResponse]
|
115
128
|
#
|
116
129
|
# @example
|
117
|
-
# response = client.
|
118
|
-
#
|
130
|
+
# response = client.matches_request(limit: 1)
|
131
|
+
# # => ZombieBattleground::Api::Responses::GetMatchesResponse
|
119
132
|
#
|
120
133
|
# @api public
|
121
|
-
def
|
134
|
+
def matches_request(**args)
|
122
135
|
request = ZombieBattleground::Api::Requests::GetMatchesRequest.new
|
123
136
|
args.each { |key, val| request.send("#{key}=", val) }
|
124
137
|
raise ZombieBattleground::Api::Errors::InvalidInput, request.errors.messages unless request.valid?
|
@@ -140,11 +153,11 @@ module ZombieBattleground
|
|
140
153
|
# @raise [ZombieBattleground::Api::Errors::InvalidInput, ZombieBattleground::Api::Errors::InvalidResponse]
|
141
154
|
#
|
142
155
|
# @example
|
143
|
-
# response = client.
|
144
|
-
#
|
156
|
+
# response = client.match_request(id: 1454)
|
157
|
+
# # => ZombieBattleground::Api::Responses::GetMatchResponse
|
145
158
|
#
|
146
159
|
# @api public
|
147
|
-
def
|
160
|
+
def match_request(**args)
|
148
161
|
request = ZombieBattleground::Api::Requests::GetMatchRequest.new
|
149
162
|
args.each { |key, val| request.send("#{key}=", val) }
|
150
163
|
raise ZombieBattleground::Api::Errors::InvalidInput, request.errors.messages unless request.valid?
|
@@ -179,11 +192,11 @@ module ZombieBattleground
|
|
179
192
|
# @raise [ZombieBattleground::Api::Errors::InvalidInput, ZombieBattleground::Api::Errors::InvalidResponse]
|
180
193
|
#
|
181
194
|
# @example
|
182
|
-
# response = client.
|
183
|
-
#
|
195
|
+
# response = client.cards_request(limit: 1)
|
196
|
+
# # => ZombieBattleground::Api::Responses::GetCardsResponse
|
184
197
|
#
|
185
198
|
# @api public
|
186
|
-
def
|
199
|
+
def cards_request(**args)
|
187
200
|
request = ZombieBattleground::Api::Requests::GetCardsRequest.new
|
188
201
|
args.each { |key, val| request.send("#{key}=", val) }
|
189
202
|
raise ZombieBattleground::Api::Errors::InvalidInput, request.errors.messages unless request.valid?
|
@@ -206,11 +219,11 @@ module ZombieBattleground
|
|
206
219
|
# @raise [ZombieBattleground::Api::Errors::InvalidInput, ZombieBattleground::Api::Errors::InvalidResponse]
|
207
220
|
#
|
208
221
|
# @example
|
209
|
-
# response = client.
|
210
|
-
#
|
222
|
+
# response = client.card_request(mould_id: 2, version: 'v3')
|
223
|
+
# # => ZombieBattleground::Api::Responses::GetCardResponse
|
211
224
|
#
|
212
225
|
# @api public
|
213
|
-
def
|
226
|
+
def card_request(**args)
|
214
227
|
request = ZombieBattleground::Api::Requests::GetCardRequest.new
|
215
228
|
args.each { |key, val| request.send("#{key}=", val) }
|
216
229
|
raise ZombieBattleground::Api::Errors::InvalidInput, request.errors.messages unless request.valid?
|
@@ -1,6 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require 'zombie_battleground/api/version'
|
4
3
|
require 'zombie_battleground/api/client'
|
5
4
|
|
6
5
|
module ZombieBattleground
|
@@ -11,7 +10,7 @@ module ZombieBattleground
|
|
11
10
|
|
12
11
|
class << self
|
13
12
|
##
|
14
|
-
# Queries for Decks
|
13
|
+
# Queries for Decks and returns a modeled response
|
15
14
|
#
|
16
15
|
# @param id [Integer] Optionally filter on Deck id
|
17
16
|
# @param user_id [String] Optionally filter on Deck user_id
|
@@ -27,32 +26,73 @@ module ZombieBattleground
|
|
27
26
|
# @return [ZombieBattleground::Api::Responses::GetDecksResponse]
|
28
27
|
#
|
29
28
|
# @example
|
30
|
-
# response = ZombieBattleground::Api.
|
31
|
-
#
|
29
|
+
# response = ZombieBattleground::Api.decks_request(limit: 1)
|
30
|
+
# # => ZombieBattleground::Api::Responses::GetDecksResponse
|
31
|
+
#
|
32
|
+
# @api public
|
33
|
+
def decks_request(**args)
|
34
|
+
@client.decks_request(**args)
|
35
|
+
end
|
36
|
+
|
37
|
+
##
|
38
|
+
# Queries for Decks and returns the decks in the response
|
39
|
+
#
|
40
|
+
# @param id [Integer] Optionally filter on Deck id
|
41
|
+
# @param user_id [String] Optionally filter on Deck user_id
|
42
|
+
# @param deck_id [Integer] Optionally filter on Deck deck_id
|
43
|
+
# @param name [String] Optionally filter on Deck name
|
44
|
+
# @param hero_id [Integer] Optionally filter on Deck hero_id
|
45
|
+
# @param primary_skill_id [Integer] Optionally filter on Deck primary_skill_id
|
46
|
+
# @param secondary_skill_id [Integer] Optionally filter on Deck secondary_skill_id
|
47
|
+
# @param version [String] Optionally filter on Deck version
|
48
|
+
# @param page [Integer] Used for pagination of query results
|
49
|
+
# @param limit [Integer] Used for pagination of query results. Max 100
|
50
|
+
#
|
51
|
+
# @return [Array<ZombieBattleground::Api::Models::Deck>]
|
52
|
+
#
|
53
|
+
# @example
|
54
|
+
# decks = ZombieBattleground::Api.decks(limit: 1)
|
55
|
+
# # => [ZombieBattleground::Api::Models::Deck]
|
32
56
|
#
|
33
57
|
# @api public
|
34
58
|
def decks(**args)
|
35
|
-
@client.
|
59
|
+
@client.decks_request(**args).decks
|
36
60
|
end
|
37
61
|
|
38
62
|
##
|
39
|
-
# Queries for a Deck
|
63
|
+
# Queries for a Deck and returns the response
|
40
64
|
#
|
41
65
|
# @param id [Integer] Deck id to request
|
42
66
|
#
|
43
67
|
# @return [ZombieBattleground::Api::Responses::GetDeckResponse]
|
44
68
|
#
|
45
69
|
# @example
|
46
|
-
# response = ZombieBattleground::Api.
|
47
|
-
#
|
70
|
+
# response = ZombieBattleground::Api.deck_request(id: 1813)
|
71
|
+
# # => ZombieBattleground::Api::Responses::GetDeckResponse
|
72
|
+
#
|
73
|
+
# @api public
|
74
|
+
def deck_request(**args)
|
75
|
+
@client.deck_request(**args)
|
76
|
+
end
|
77
|
+
|
78
|
+
##
|
79
|
+
# Queries for a Deck and returns deck in the response
|
80
|
+
#
|
81
|
+
# @param id [Integer] Deck id to request
|
82
|
+
#
|
83
|
+
# @return [ZombieBattleground::Api::Models::Deck]
|
84
|
+
#
|
85
|
+
# @example
|
86
|
+
# deck = ZombieBattleground::Api.deck(id: 1813)
|
87
|
+
# # => ZombieBattleground::Api::Models::Deck
|
48
88
|
#
|
49
89
|
# @api public
|
50
90
|
def deck(**args)
|
51
|
-
@client.
|
91
|
+
@client.deck_request(**args).deck
|
52
92
|
end
|
53
93
|
|
54
94
|
##
|
55
|
-
# Queries for Matches
|
95
|
+
# Queries for Matches and returns the response
|
56
96
|
#
|
57
97
|
# @param id [Integer] Optionally filter on Match id
|
58
98
|
# @param player1_id [String] Optionally filter on Match player1_id
|
@@ -66,32 +106,71 @@ module ZombieBattleground
|
|
66
106
|
# @return [ZombieBattleground::Api::Responses::GetMatchesResponse]
|
67
107
|
#
|
68
108
|
# @example
|
69
|
-
# response = ZombieBattleground::Api.
|
70
|
-
#
|
109
|
+
# response = ZombieBattleground::Api.matches_request(limit: 1)
|
110
|
+
# # => ZombieBattleground::Api::Responses::GetMatchesResponse
|
111
|
+
#
|
112
|
+
# @api public
|
113
|
+
def matches_request(**args)
|
114
|
+
@client.matches_request(**args)
|
115
|
+
end
|
116
|
+
|
117
|
+
##
|
118
|
+
# Queries for Matches and returns the matches in the response
|
119
|
+
#
|
120
|
+
# @param id [Integer] Optionally filter on Match id
|
121
|
+
# @param player1_id [String] Optionally filter on Match player1_id
|
122
|
+
# @param player2_id [String] Optionally filter on Match player2_id
|
123
|
+
# @param status [String] Optionally filter on Match status
|
124
|
+
# @param version [String] Optionally filter on Match version
|
125
|
+
# @param winner_id [String] Optionally filter on Match winner_id
|
126
|
+
# @param page [Integer] Used for pagination of query results
|
127
|
+
# @param limit [Integer] Used for pagination of query results. Max 100
|
128
|
+
#
|
129
|
+
# @return [Array<ZombieBattleground::Api::Models::Match>]
|
130
|
+
#
|
131
|
+
# @example
|
132
|
+
# matches = ZombieBattleground::Api.matches(limit: 1)
|
133
|
+
# # => ZombieBattleground::Api::Models::Match
|
71
134
|
#
|
72
135
|
# @api public
|
73
136
|
def matches(**args)
|
74
|
-
@client.
|
137
|
+
@client.matches_request(**args).matches
|
75
138
|
end
|
76
139
|
|
77
140
|
##
|
78
|
-
# Queries for a Match
|
141
|
+
# Queries for a Match and returns the response
|
79
142
|
#
|
80
143
|
# @param id [Integer] Match id to request
|
81
144
|
#
|
82
145
|
# @return [ZombieBattleground::Api::Responses::GetMatchResponse]
|
83
146
|
#
|
84
147
|
# @example
|
85
|
-
# response = ZombieBattleground::Api.
|
148
|
+
# response = ZombieBattleground::Api.match_request(id: 1454)
|
86
149
|
# response # => ZombieBattleground::Api::Responses::GetMatchResponse
|
87
150
|
#
|
88
151
|
# @api public
|
152
|
+
def match_request(**args)
|
153
|
+
@client.match_request(**args)
|
154
|
+
end
|
155
|
+
|
156
|
+
##
|
157
|
+
# Queries for a Match and returns the match in the response
|
158
|
+
#
|
159
|
+
# @param id [Integer] Match id to request
|
160
|
+
#
|
161
|
+
# @return [ZombieBattleground::Api::Models::Match]
|
162
|
+
#
|
163
|
+
# @example
|
164
|
+
# match = ZombieBattleground::Api.match(id: 1454)
|
165
|
+
# # => ZombieBattleground::Api::Models::Match
|
166
|
+
#
|
167
|
+
# @api public
|
89
168
|
def match(**args)
|
90
|
-
@client.
|
169
|
+
@client.match_request(**args).match
|
91
170
|
end
|
92
171
|
|
93
172
|
##
|
94
|
-
# Queries for Cards
|
173
|
+
# Queries for Cards and returns the response
|
95
174
|
#
|
96
175
|
# @param id [Integer] Optionally filter on Card id
|
97
176
|
# @param mould_id [String] Optionally filter on Card mould_id
|
@@ -111,16 +190,45 @@ module ZombieBattleground
|
|
111
190
|
# @return [ZombieBattleground::Api::Responses::GetCardsResponse]
|
112
191
|
#
|
113
192
|
# @example
|
114
|
-
# response = ZombieBattleground::Api.
|
115
|
-
#
|
193
|
+
# response = ZombieBattleground::Api.cards_request(limit: 1)
|
194
|
+
# # => ZombieBattleground::Api::Responses::GetCardsResponse
|
195
|
+
#
|
196
|
+
# @api public
|
197
|
+
def cards_request(**args)
|
198
|
+
@client.cards_request(**args)
|
199
|
+
end
|
200
|
+
|
201
|
+
##
|
202
|
+
# Queries for Cards and returns the cards in the response
|
203
|
+
#
|
204
|
+
# @param id [Integer] Optionally filter on Card id
|
205
|
+
# @param mould_id [String] Optionally filter on Card mould_id
|
206
|
+
# @param version [String] Optionally filter on Card version
|
207
|
+
# @param kind [String] Optionally filter on Card kind
|
208
|
+
# @param set [String] Optionally filter on Card set
|
209
|
+
# @param name [String] Optionally filter on Card name
|
210
|
+
# @param rank [String] Optionally filter on Card rank
|
211
|
+
# @param type [String] Optionally filter on Card type
|
212
|
+
# @param rarity [String] Optionally filter on Card rarity
|
213
|
+
# @param damage [Integer] Optionally filter on Card damage
|
214
|
+
# @param health [Integer] Optionally filter on Card health
|
215
|
+
# @param cost [Integer] Optionally filter on Card cost
|
216
|
+
# @param page [Integer] Used for pagination of query results
|
217
|
+
# @param limit [Integer] Used for pagination of query results. Max 100
|
218
|
+
#
|
219
|
+
# @return [Array<ZombieBattleground::Api::Models::Card>]
|
220
|
+
#
|
221
|
+
# @example
|
222
|
+
# cards = ZombieBattleground::Api.cards(limit: 1)
|
223
|
+
# # => [ZombieBattleground::Api::Models::Card]
|
116
224
|
#
|
117
225
|
# @api public
|
118
226
|
def cards(**args)
|
119
|
-
@client.
|
227
|
+
@client.cards_request(**args).cards
|
120
228
|
end
|
121
229
|
|
122
230
|
##
|
123
|
-
# Queries for a Card
|
231
|
+
# Queries for a Card and returns the response
|
124
232
|
#
|
125
233
|
# @param mould_id [String] Optionally filter on Card mould_id
|
126
234
|
# @param version [String] Optionally filter on Card version
|
@@ -129,11 +237,28 @@ module ZombieBattleground
|
|
129
237
|
#
|
130
238
|
# @example
|
131
239
|
# response = ZombieBattleground::Api.card(mould_id: 2, version: 'v3')
|
132
|
-
#
|
240
|
+
# # => ZombieBattleground::Api::Responses::GetCardResponse
|
241
|
+
#
|
242
|
+
# @api public
|
243
|
+
def card_request(**args)
|
244
|
+
@client.card_request(**args)
|
245
|
+
end
|
246
|
+
|
247
|
+
##
|
248
|
+
# Queries for a Card and returns the card in the response
|
249
|
+
#
|
250
|
+
# @param mould_id [String] Optionally filter on Card mould_id
|
251
|
+
# @param version [String] Optionally filter on Card version
|
252
|
+
#
|
253
|
+
# @return [ZombieBattleground::Api::Models::Card]
|
254
|
+
#
|
255
|
+
# @example
|
256
|
+
# card = ZombieBattleground::Api.card(mould_id: 2, version: 'v3')
|
257
|
+
# # => ZombieBattleground::Api::Models::Card
|
133
258
|
#
|
134
259
|
# @api public
|
135
260
|
def card(**args)
|
136
|
-
@client.
|
261
|
+
@client.card_request(**args).card
|
137
262
|
end
|
138
263
|
end
|
139
264
|
end
|
@@ -30,11 +30,13 @@ Gem::Specification.new do |spec|
|
|
30
30
|
spec.require_paths = ['lib']
|
31
31
|
|
32
32
|
spec.add_development_dependency 'bundler', '~> 1.16'
|
33
|
+
spec.add_development_dependency 'coveralls'
|
33
34
|
spec.add_development_dependency 'gem-release'
|
34
35
|
spec.add_development_dependency 'rake', '~> 10.0'
|
35
36
|
spec.add_development_dependency 'rspec', '~> 3.0'
|
36
37
|
spec.add_development_dependency 'rubocop'
|
37
38
|
spec.add_development_dependency 'simplecov'
|
39
|
+
spec.add_development_dependency 'webmock'
|
38
40
|
spec.add_development_dependency 'yard'
|
39
41
|
spec.add_development_dependency 'yardstick'
|
40
42
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: zombie_battleground-api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- John Shields
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-02-
|
11
|
+
date: 2019-02-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -24,6 +24,20 @@ dependencies:
|
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '1.16'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: coveralls
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
27
41
|
- !ruby/object:Gem::Dependency
|
28
42
|
name: gem-release
|
29
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -94,6 +108,20 @@ dependencies:
|
|
94
108
|
- - ">="
|
95
109
|
- !ruby/object:Gem::Version
|
96
110
|
version: '0'
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: webmock
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - ">="
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '0'
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - ">="
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '0'
|
97
125
|
- !ruby/object:Gem::Dependency
|
98
126
|
name: yard
|
99
127
|
requirement: !ruby/object:Gem::Requirement
|