bungie_client 2.1.0 → 2.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/lib/bungie_client/client.rb +5 -3
- data/lib/bungie_client/version.rb +1 -1
- data/lib/bungie_client/wrapper.rb +4 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1c0520384097c04845a8727368183f12c86ef09d
|
4
|
+
data.tar.gz: 137faa6ad7171bb62df90c1ef3a8832df373fb3b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2ed2580548d4b347b39a64b5685ea5bc983bfb37aae736c2aefbbac8f45572ff1821fb202e8a78389efa2b290dd79083ecc0b9630657e649343145d2498b56f1
|
7
|
+
data.tar.gz: 94a551ad42ec1b8c3e24e635938ce935a5f72e8b43834a8ee1c7984c6d34dac5263e0d17a70b66acd0daff78ee0c4a745c276683359f7036f755b26bfe82097c
|
data/CHANGELOG.md
CHANGED
data/lib/bungie_client/client.rb
CHANGED
@@ -62,19 +62,21 @@ class BungieClient::Client
|
|
62
62
|
#
|
63
63
|
# @param [String] url
|
64
64
|
# @param [Hash] parameters for http-query
|
65
|
+
# @param [Hash] headers
|
65
66
|
#
|
66
67
|
# @return [Mash]
|
67
|
-
def get(url, parameters = {})
|
68
|
-
self.class.parse @conn.get(url, parameters).body rescue Hashie::Mash.new
|
68
|
+
def get(url, parameters = {}, headers = {})
|
69
|
+
self.class.parse @conn.get(url, parameters, headers).body rescue Hashie::Mash.new
|
69
70
|
end
|
70
71
|
|
71
72
|
# Post data to Bungie services
|
72
73
|
#
|
73
74
|
# @param [String] url
|
74
75
|
# @param [Hash] query
|
76
|
+
# @param [Hash] headers
|
75
77
|
#
|
76
78
|
# @return [Mash]
|
77
79
|
def post(url, query = {})
|
78
|
-
self.class.parse @conn.post(url, query).body rescue Hashie::Mash.new
|
80
|
+
self.class.parse @conn.post(url, query, headers).body rescue Hashie::Mash.new
|
79
81
|
end
|
80
82
|
end
|
@@ -45,19 +45,20 @@ class BungieClient::Wrapper
|
|
45
45
|
# @param [String] service name in snake case
|
46
46
|
# @param [Hash] params service parameters
|
47
47
|
# @param [Hash] options for client request (get/post)
|
48
|
+
# @param [Hash] headers
|
48
49
|
#
|
49
50
|
# @return [Hashie::Mash]
|
50
|
-
def call_service(service, params = {}, options = {})
|
51
|
+
def call_service(service, params = {}, options = {}, headers = {})
|
51
52
|
service = BungieClient::Service.new service rescue raise NoMethodError
|
52
53
|
|
53
54
|
# change url
|
54
55
|
url = self.fill_url service.endpoint, params
|
55
56
|
|
56
57
|
# send request
|
57
|
-
client.send service.type, url, options
|
58
|
+
client.send service.type, url, options, headers
|
58
59
|
end
|
59
60
|
|
60
61
|
def method_missing(*args)
|
61
|
-
call_service args[0].to_s, args[1] || {}, args[2] || {}
|
62
|
+
call_service args[0].to_s, args[1] || {}, args[2] || {}, args[3] || {}
|
62
63
|
end
|
63
64
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bungie_client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.1.
|
4
|
+
version: 2.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dmitry Ruban
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-06-
|
11
|
+
date: 2017-06-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|