brawlhalla-api 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/console +1 -0
- data/lib/brawlhalla/api/client.rb +5 -1
- data/lib/brawlhalla/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: f310ac8c3173ecc2bee89c74be6f583834ce682de221bd00c85328da5d5354db
|
4
|
+
data.tar.gz: 5abb167944bdd6e4eb25e72444eb0845ca193d7283db1a599dcc1d638cc61d31
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0b7402abd66e1613690bcfd15d2fd1763abefbb55bff2f5e57bbb92df1cdb9bb0e1b078623f4e3c5ebf9dd848bc7bb0d1dd12d185d43f0024d97a238af477bb1
|
7
|
+
data.tar.gz: 21f6e0f45896fc3c2d6b2284b63553ceae3a8228f2aca9b0c38be7206c41518380223d6d9d0dba3fe9a15e8a07351a219f0dce2c3f05f145f61c5f733ee5e734
|
data/bin/console
CHANGED
@@ -1,10 +1,13 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Brawlhalla
|
2
4
|
module API
|
3
5
|
class Client
|
4
6
|
BASE_URL = 'https://api.brawlhalla.com'
|
5
7
|
|
6
|
-
def initialize(api_key)
|
8
|
+
def initialize(api_key, debug: false)
|
7
9
|
@api_key = api_key
|
10
|
+
@debug = debug
|
8
11
|
end
|
9
12
|
|
10
13
|
# Search player by Steam ID.
|
@@ -44,6 +47,7 @@ module Brawlhalla
|
|
44
47
|
conn.headers['Content-Type'] = 'application/json'
|
45
48
|
conn.use FaradayMiddleware::ParseJson
|
46
49
|
conn.response :json, parser_options: { symbolize_names: true }
|
50
|
+
conn.response :logger if @debug
|
47
51
|
conn.adapter Faraday.default_adapter
|
48
52
|
end
|
49
53
|
end
|