restful_resource 2.4.0 → 2.5.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: 1f5f98400c48167cdb639a07e34ec5556d6d3ee4120686e1c97b1a21f46c1288
4
- data.tar.gz: bf34cb96327e7420f7efd0c08bac8ffee01efea9ae104eef4bb24c03da0265a9
3
+ metadata.gz: 518adcf1420c8305d189766883817e8c71d8cd09ffe472270e2a2cfa0e6a1103
4
+ data.tar.gz: 82fdbfd0ace4c8c2e8aca022e60b6a55cf84177add1719fb9d5e55b504aacb84
5
5
  SHA512:
6
- metadata.gz: '04010962bd8ad44f0ed445641997bf8604fad6b0b694f181040e552856730cbdf26b4e30b3cd62bd90b4e4ec152dd1811d67fad63b8efe4bfb5c6687e27e0b55'
7
- data.tar.gz: cc0f65d304132e7eb25d601e19e491c12e584ef896681862ca4a3bda1e97e2500efb80afa5e783ab55a09d468ce87baeec1880280dd1ece333a61efc7503df8b
6
+ metadata.gz: 9ae13ab26b3ce3d49061db7ca21f4ec1d41358120f54039e0b9f8a549aaf867a2e192b132173f52f7d38fb911c978fbffd0c74e8a574d4a64688d21a48b5b3f9
7
+ data.tar.gz: b5a9fe7a39f196739016b340c933d693126fceac8f93cc707bd8d1b69e13e7caf9c6a318a8e8bf36457ec0e2269c2038bf2389baf9abb4f08b90ca9828888398
data/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # Changelog
2
2
 
3
+ 2.5.0
4
+ ---
5
+
6
+ - Add support for `PATCH`
7
+
3
8
  v2.4.0
4
9
  ---
5
10
 
@@ -57,6 +57,16 @@ module RestfulResource
57
57
  RestfulResource::OpenObject.new(parse_json(response.body))
58
58
  end
59
59
 
60
+ def self.patch(id, data: {}, headers: {}, **params)
61
+ params_without_options, options = format_params(params)
62
+ options.delete(:headers)
63
+
64
+ url = member_url(id, params_without_options)
65
+
66
+ response = http.patch(url, data: data, headers: headers, **options)
67
+ new(parse_json(response.body))
68
+ end
69
+
60
70
  def self.put(id, data: {}, headers: {}, **params)
61
71
  params_without_options, options = format_params(params)
62
72
  options.delete(:headers)
@@ -143,6 +143,19 @@ module RestfulResource
143
143
  )
144
144
  end
145
145
 
146
+ def patch(url, data: {}, headers: {}, open_timeout: nil, timeout: nil)
147
+ http_request(
148
+ Request.new(
149
+ :patch,
150
+ url,
151
+ body: data,
152
+ headers: headers,
153
+ open_timeout: open_timeout,
154
+ timeout: timeout
155
+ )
156
+ )
157
+ end
158
+
146
159
  def put(url, data: {}, headers: {}, open_timeout: nil, timeout: nil)
147
160
  http_request(
148
161
  Request.new(
@@ -1,3 +1,3 @@
1
1
  module RestfulResource
2
- VERSION = '2.4.0'.freeze
2
+ VERSION = '2.5.0'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: restful_resource
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.4.0
4
+ version: 2.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Santoro
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2018-11-08 00:00:00.000000000 Z
12
+ date: 2018-11-21 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler