beyond_api 0.7.0.pre → 0.7.1.pre
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/Gemfile.lock +1 -1
- data/lib/beyond_api.rb +2 -0
- data/lib/beyond_api/request.rb +3 -3
- data/lib/beyond_api/resources/base.rb +3 -4
- data/lib/beyond_api/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6e0129444a024277fbe0f4abee48a66429124bd1a2e6a58111c9de45009a3a33
|
4
|
+
data.tar.gz: d2456258eb86285646a5cd0560f76156a54eaea591375c6b3a9a11e85811bbd5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e068ce40c0df8c695b847d086bb214f4d6b77839743ed1c8284d5be7e765fbeb3d0d6db6757ee6c74aae201765b1e4c47997292100f461cb64cd1608e376395f
|
7
|
+
data.tar.gz: 2196eed2089a57bd8eed949b2076d963e079324aaeccb08e5e3bb566e2a6f48c71177e6301d43fcef8aaf83e1a68f08fead959db0d74763da3a0b832899ec4b6
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
data/lib/beyond_api.rb
CHANGED
data/lib/beyond_api/request.rb
CHANGED
@@ -9,7 +9,7 @@ module BeyondApi
|
|
9
9
|
define_method(method) do |session, path, params = {}|
|
10
10
|
response = BeyondApi::Connection.default.send(method) do |request|
|
11
11
|
request.url(session.api_url + path)
|
12
|
-
request.headers['Authorization'] = "Bearer #{ session.access_token }"
|
12
|
+
request.headers['Authorization'] = "Bearer #{ session.access_token }" unless session.access_token.nil?
|
13
13
|
request.params = params.to_h.camelize_keys
|
14
14
|
end
|
15
15
|
|
@@ -21,7 +21,7 @@ module BeyondApi
|
|
21
21
|
define_method(method) do |session, path, body = {}, params = {}|
|
22
22
|
response = BeyondApi::Connection.default.send(method) do |request|
|
23
23
|
request.url(session.api_url + path)
|
24
|
-
request.headers['Authorization'] = "Bearer #{ session.access_token }"
|
24
|
+
request.headers['Authorization'] = "Bearer #{ session.access_token }" unless session.access_token.nil?
|
25
25
|
request.params = params.to_h.camelize_keys
|
26
26
|
request.body = body.camelize_keys.to_json
|
27
27
|
end
|
@@ -34,7 +34,7 @@ module BeyondApi
|
|
34
34
|
def self.upload(session, path, file_binary, content_type, params)
|
35
35
|
response = BeyondApi::Connection.default.post do |request|
|
36
36
|
request.url(session.api_url + path)
|
37
|
-
request.headers['Authorization'] = "Bearer #{ session.access_token }"
|
37
|
+
request.headers['Authorization'] = "Bearer #{ session.access_token }" unless session.access_token.nil?
|
38
38
|
request.headers['Content-Type'] = content_type
|
39
39
|
request.params = params.to_h.camelize_keys
|
40
40
|
request.body = file_binary
|
@@ -8,10 +8,9 @@ module BeyondApi
|
|
8
8
|
|
9
9
|
def initialize(session)
|
10
10
|
@session = session
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
end
|
11
|
+
|
12
|
+
raise InvalidSessionError, "Invalid session" unless session.is_a? BeyondApi::Session
|
13
|
+
raise InvalidSessionError, "Session api_url cannot be nil" if session.api_url.nil?
|
15
14
|
end
|
16
15
|
end
|
17
16
|
end
|
data/lib/beyond_api/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: beyond_api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.1.pre
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Unai Abrisketa
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: exe
|
12
12
|
cert_chain: []
|
13
|
-
date: 2020-02-
|
13
|
+
date: 2020-02-20 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: bundler
|