fulfil-io 0.4.4 → 0.4.5

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: 7be62208f07b3dabac64da70cd97d7ef5d5e513a363d830206ffc6ad25ebffc5
4
- data.tar.gz: ddba02ac333a132dcce3886f51b35865d58f4a999adba7f1f10a9ee3cec5e344
3
+ metadata.gz: 520488638d7340fb0278fc798770d821f87f0a7427765118c418f2db16877af1
4
+ data.tar.gz: 7c1dfb2aac58524eef56a7d38729ffd01f3350ff3413bd7e0b6fa8bf6ab37411
5
5
  SHA512:
6
- metadata.gz: 02e3e8e5ae922598b1971b96ba26ba2a17c6f05cc4c2ea319bc0e3d69b75fdfc9115ee860b43d4c2965e292f80470ea17d9c07819d0d30aef03610fa1611ae85
7
- data.tar.gz: 000740a6f8cff338590329900671bf297acfd41c83f38c5197bac711706ac934b37e39e55ec5683575b6e9ffbfead3f73b6d766afb4b0d8a5e357aa6db9c6c4b
6
+ metadata.gz: 035bc157721ab0b620cf30b99afdaf3825a2f8732e289a7b9e2b309bc99d25ec81cd3f1612ce88df4dcdb98a05a56fff295e8461f7a525e741e5d3200be8c9b6
7
+ data.tar.gz: 0bb63dba2c5ee6d608d7b4d5b22895538ea288dde9423fac5bf133c37b24bb3a00b68dd2329a1b1874d0293e755165d0ce033df72e319de3e7204d9461de151c
data/CHANGELOG.md CHANGED
@@ -1,3 +1,8 @@
1
+ ## 0.4.5
2
+
3
+ * Add #delete to client.
4
+ * Set up Dependabot on GitHub.
5
+
1
6
  ## 0.4.4
2
7
 
3
8
  * Pin http dependency to ~> 4.4.0. 5.0+ introduces a frozen string error.
data/lib/fulfil/client.rb CHANGED
@@ -78,6 +78,13 @@ module Fulfil
78
78
  parse(result: result)
79
79
  end
80
80
 
81
+ def delete(model:, id:)
82
+ uri = URI(model_url(model: model, id: id))
83
+
84
+ result = request(verb: :delete, endpoint: uri)
85
+ parse(result: result)
86
+ end
87
+
81
88
  private
82
89
 
83
90
  def parse(result: nil, results: [])
@@ -109,6 +116,8 @@ module Fulfil
109
116
 
110
117
  if response.status.ok? || response.status.created?
111
118
  response.parse
119
+ elsif response.code == 204
120
+ []
112
121
  elsif response.code == 401
113
122
  error = response.parse
114
123
  raise NotAuthorizedError, "Not authorized: #{error['error']}: #{error['error_description']}"
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Fulfil
4
- VERSION = '0.4.4'
4
+ VERSION = '0.4.5'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fulfil-io
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.4
4
+ version: 0.4.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Moore
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2021-05-20 00:00:00.000000000 Z
12
+ date: 2021-11-30 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: http
@@ -134,7 +134,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
134
134
  - !ruby/object:Gem::Version
135
135
  version: '0'
136
136
  requirements: []
137
- rubygems_version: 3.1.4
137
+ rubygems_version: 3.1.6
138
138
  signing_key:
139
139
  specification_version: 4
140
140
  summary: Interact with the Fulfil.io API