async-rest 0.4.0 → 0.5.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/async/rest/resource.rb +18 -12
- data/lib/async/rest/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: 548f923968025491a47661619f728208c7c319dc33b03fac48d8a4d28be69ce8
|
4
|
+
data.tar.gz: 31da938bb7b4aae9e51d16b2ef81c3877b77e3ec2e69b3c006e405446b922f80
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0c71a771cdd839421f9de1e242710ce03b101d8339a2154536e667eb332965e7937da61405bea3152de1cbb5571b3aebe53043e68a62cd04d169408cbf4f1608
|
7
|
+
data.tar.gz: c3ac3800a1a4c86cda32fc5076c81075947070dbb90f986f026b031fa83bb7b794d6845c3884fef5412f1233f39085395b78f060d771a69b6b72985a7edde155
|
data/lib/async/rest/resource.rb
CHANGED
@@ -67,22 +67,28 @@ module Async
|
|
67
67
|
attr :headers
|
68
68
|
attr :wrapper
|
69
69
|
|
70
|
-
def self.
|
71
|
-
self.new(*args, parent.delegate, parent.reference.dup(path), parent.headers,
|
70
|
+
def self.with(parent, *args, headers: {}, parameters: nil, path: nil, wrapper: parent.wrapper)
|
71
|
+
self.new(*args, parent.delegate, parent.reference.dup(path, parameters), parent.headers.merge(headers), wrapper)
|
72
72
|
end
|
73
73
|
|
74
|
-
def
|
75
|
-
self.class.
|
74
|
+
def with(*args, **options)
|
75
|
+
self.class.with(self, *args, **options)
|
76
76
|
end
|
77
77
|
|
78
|
-
def
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
78
|
+
def prepare_request(verb, payload = nil, **parameters)
|
79
|
+
if parameters.empty?
|
80
|
+
reference = @reference
|
81
|
+
else
|
82
|
+
reference = @reference.dup(nil, parameters)
|
83
|
+
end
|
84
|
+
|
85
|
+
headers = @headers.dup
|
86
|
+
|
87
|
+
if payload
|
88
|
+
body = @wrapper.prepare_request(payload, headers)
|
89
|
+
else
|
90
|
+
body = nil
|
91
|
+
end
|
86
92
|
|
87
93
|
return HTTP::Request[verb, reference, headers, body]
|
88
94
|
end
|
data/lib/async/rest/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: async-rest
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Samuel Williams
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-10-
|
11
|
+
date: 2018-10-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: async-http
|