bugherd_client 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/bugherd_client/resources/v2/base.rb +7 -2
- data/lib/bugherd_client/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b6437162c7b70967ec8d317fb437ed9208cfcf74
|
4
|
+
data.tar.gz: 98a4222487963a6fda96d8c46d4b1a2324c91fe8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4d69d47f02a5c1243f8a2d4fdf99ec7c9b2d3334a59d1277246c114c2976f886a586271cac107c5dac46da1ecc13455ffacced1a1ba29821d750e96e226a396d
|
7
|
+
data.tar.gz: e0b4c620dd38842d3f4287c4fe5eb252477cbd7594bf06cf8acd069466f00ecc9d372ebc93c86b3ac78345e4b3afa7fec6e0b6cc327140749287df2228fac19c
|
@@ -6,15 +6,19 @@ module BugherdClient
|
|
6
6
|
|
7
7
|
class Base
|
8
8
|
|
9
|
-
|
9
|
+
DEFAULT_HEADER_ATTRS = {
|
10
|
+
:content_type => :json,
|
11
|
+
:accept => :json
|
12
|
+
}.freeze
|
10
13
|
|
11
14
|
attr_accessor :connection, :options
|
15
|
+
|
12
16
|
def initialize(conn, opts={})
|
13
17
|
@connection, @options = conn, opts
|
14
18
|
end
|
15
19
|
|
16
20
|
def send_request(method="GET", path="", params={}, headers={})
|
17
|
-
headers =
|
21
|
+
headers = DEFAULT_HEADER_ATTRS.merge(headers)
|
18
22
|
params.merge!(headers)
|
19
23
|
method_name = method.to_s.downcase
|
20
24
|
self.connection[path].__send__(method_name, params)
|
@@ -33,6 +37,7 @@ module BugherdClient
|
|
33
37
|
JSON.parse(response)
|
34
38
|
end
|
35
39
|
end
|
40
|
+
|
36
41
|
end
|
37
42
|
|
38
43
|
end
|