async-rest 0.17.0 → 0.18.0

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: b8b711b28f3b500c7d4cf7730fb6a91d210b2e03b6a8f4b3af26aaf71124a2ed
4
- data.tar.gz: 52f0a4d55f68c67a3e0947e333c186a66c775dc0b1784217932ae9abdac5d2fa
3
+ metadata.gz: 2b382d2957eae86372238557c07d854d654e3ed63b0e49ffa95250f6cc81b1a6
4
+ data.tar.gz: 6f01d8c70c1f66a1909892340856893fb1f17a815e2019ecc08a40e0308d5311
5
5
  SHA512:
6
- metadata.gz: ad395d69a4c5db1ef31f7a59182e07045a82e028553f95efe11355668c061107e98fc8e5c7c957c85b876d283cab47f3f1d28771042a91aed242d7ee44f6df91
7
- data.tar.gz: 186cc200fbdc8c16ffccb89300f80fd8e58ee34af6cafa3d0165291d032553626eb2c58369d22de6b2522c44a9d198e188c918b316ba194a95423d1d42e5364a
6
+ metadata.gz: 836f2fea74f220a114ffd6557ad04e46e2ae28b417533e7974ce0fbf45e590367cad640c7c35a292e85f6186257ef74ac4019115198733bfaafce5a7a1de2f1e
7
+ data.tar.gz: 3391c4a281443add49271025386414b4b5454890b0a069ed2730ec774696b06a9b8a4af402cdbd5576989876b1840144b10af71571c7b2e4337244bf932fe691
checksums.yaml.gz.sig CHANGED
Binary file
@@ -103,33 +103,29 @@ module Async
103
103
 
104
104
  # Provides a way to mutate the value of the representation.
105
105
  module Mutable
106
- def value= value
107
- @value = self.assign(value)
106
+ def post(value)
107
+ self.class.post(@resource, value) do |resource, response|
108
+ @value = response.read
109
+
110
+ self
111
+ end
108
112
  end
109
113
 
110
- def call(value)
114
+ def delete
115
+ self.class.delete(@resource)
116
+ end
117
+
118
+ def assign(value)
111
119
  if value
112
120
  self.post(value)
113
121
  else
114
122
  self.delete
115
123
  end
116
124
  end
117
-
118
- def assign(value)
119
- response = self.call(value)
120
-
121
- response.read
122
-
123
- return @value
124
- end
125
-
126
- def update
127
- @value = assign(@value)
128
- end
129
125
  end
130
126
 
131
127
  def inspect
132
- "\#<#{self.class} #{@resource.inspect} value=#{@value.inspect}>"
128
+ "\#<#{self.class} #{@resource.path.inspect} value=#{@value.inspect}>"
133
129
  end
134
130
  end
135
131
  end
@@ -70,6 +70,10 @@ module Async
70
70
  self.class.with(self, **options)
71
71
  end
72
72
 
73
+ def path
74
+ @reference.path
75
+ end
76
+
73
77
  def inspect
74
78
  "\#<#{self.class} #{@reference.inspect} #{@headers.inspect}>"
75
79
  end
@@ -5,6 +5,6 @@
5
5
 
6
6
  module Async
7
7
  module REST
8
- VERSION = "0.17.0"
8
+ VERSION = "0.18.0"
9
9
  end
10
10
  end
@@ -7,8 +7,9 @@ module Async
7
7
  module REST
8
8
  module Wrapper
9
9
  class Generic
10
- def call(resource, verb = "GET", payload = nil, &block)
11
- request = ::Protocol::HTTP::Request[verb, nil]
10
+ def call(resource, method = "GET", payload = nil, &block)
11
+ request = ::Protocol::HTTP::Request[method, nil]
12
+
12
13
  self.prepare_request(request, payload)
13
14
 
14
15
  response = resource.call(request)
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: async-rest
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.17.0
4
+ version: 0.18.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
@@ -40,7 +40,7 @@ cert_chain:
40
40
  Q2K9NVun/S785AP05vKkXZEFYxqG6EW012U4oLcFl5MySFajYXRYbuUpH6AY+HP8
41
41
  voD0MPg1DssDLKwXyt1eKD/+Fq0bFWhwVM/1XiAXL7lyYUyOq24KHgQ2Csg=
42
42
  -----END CERTIFICATE-----
43
- date: 2024-09-12 00:00:00.000000000 Z
43
+ date: 2024-09-13 00:00:00.000000000 Z
44
44
  dependencies:
45
45
  - !ruby/object:Gem::Dependency
46
46
  name: async-http
metadata.gz.sig CHANGED
Binary file