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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6cd668d0f4cf56bec429a1953a9a0ebc4907bd4ec7d5b82539cd3d781e2c0d17
4
- data.tar.gz: 0321c55a09c7b6ef668642c7553b14178bb0fa5cdbb41697565dc81840263322
3
+ metadata.gz: f310ac8c3173ecc2bee89c74be6f583834ce682de221bd00c85328da5d5354db
4
+ data.tar.gz: 5abb167944bdd6e4eb25e72444eb0845ca193d7283db1a599dcc1d638cc61d31
5
5
  SHA512:
6
- metadata.gz: 142fadb985dd53d60375c1ba2372df44b54bafabd27e6461faef31e38034a01134224cc90203d9ffd673f9c35c4eaf7e2cddbd7946ba1bf8899bd676b2e97c0d
7
- data.tar.gz: 34a49f5f6391dca529be2e57f630b84b3da11f7818cf7f366c4560ced725f7be2a40849f71d025ca7798e127bda05985c3b9fa69cfad21b55022b20abd4cef92
6
+ metadata.gz: 0b7402abd66e1613690bcfd15d2fd1763abefbb55bff2f5e57bbb92df1cdb9bb0e1b078623f4e3c5ebf9dd848bc7bb0d1dd12d185d43f0024d97a238af477bb1
7
+ data.tar.gz: 21f6e0f45896fc3c2d6b2284b63553ceae3a8228f2aca9b0c38be7206c41518380223d6d9d0dba3fe9a15e8a07351a219f0dce2c3f05f145f61c5f733ee5e734
data/bin/console CHANGED
@@ -8,6 +8,7 @@ require 'brawlhalla/api'
8
8
  require 'dotenv'
9
9
  Dotenv.load
10
10
 
11
+ # Uncomment this line after adding your API key to .env file to use the bh client in the console.
11
12
  bh = Brawlhalla::API::Client.new(ENV['API_KEY'])
12
13
 
13
14
  require 'pry'
@@ -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
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Brawlhalla
4
4
  module API
5
- VERSION = '0.1.2'
5
+ VERSION = '0.1.3'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: brawlhalla-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - rikas