pipe_drive_ruby_wrapper 0.1.5 → 0.1.6

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: 2da6b7652b267abc3ac5d5b36d64eb90b7c98bb9aee6371808c5f38240114be1
4
- data.tar.gz: 1bd01062516cc6617b8101dd5a23468b53a49ad6ba8eb5709c1424f6185a3d53
3
+ metadata.gz: 29e4e4cec3334f54ea714b67fd93544999d7f34df879045f8c5b334ed3c01e5e
4
+ data.tar.gz: 5ff11681e7d526fab3cf43a61d9c40eec25f58c66c50fb68d424e1abf7c86d30
5
5
  SHA512:
6
- metadata.gz: 581e6214b2fa056956ac4cdda4590e7428d07470c695c1c0ba8ae00fe3e62f98c87497c1ce15a9da42ed011b5d72bfdc50a5f5dcfe517fa4e469a87e02184949
7
- data.tar.gz: fc0970e889922f4489b4097bc7b3923e80b796705e64ae8476dd39150d5191561d579158fbf45fd191db558a4b9cba983de9ac02304aa615eecca649b577491d
6
+ metadata.gz: ea7e3fa4d93bd8d84775c79ea127a54709e589fa0bbd197f1dd71a00fb6ad2f695fd8c8678e96c8d0cde1e3b0e6b57bf71625f2284fdcc281d430b42d8428346
7
+ data.tar.gz: 8fedaf080537ebff2b9a5b7d547e3ed14f5aaa012ccdb975b67839acca30f02670a611b06ae9b285623cc1597560be102c35d62d54f2eda8c251e90524f31863
data/README.md CHANGED
@@ -73,4 +73,10 @@ PipeDrive::Person.update(1, {name: 'new name'})
73
73
 
74
74
  ```ruby
75
75
  PipeDrive::Person.delete(1)
76
+ ```
77
+
78
+ * delete bulk resources one time
79
+
80
+ ```ruby
81
+ PipeDrive::Person.bulk_delete([1, 2])
76
82
  ```
@@ -58,7 +58,13 @@ module PipeDrive
58
58
 
59
59
  def delete(id)
60
60
  path = "/#{resource_name}s/#{id}"
61
- requester.http_del(path){|result| puts result}
61
+ requester.http_del(path){|result| result}
62
+ end
63
+
64
+ def bulk_delete(ids)
65
+ path = "/#{resource_name}s"
66
+ params = {ids: ids.map(&:to_s).join(',')}
67
+ requester.http_del(path, params){|result| result}
62
68
  end
63
69
 
64
70
  def search_and_setup_by(type, opts, strict=false)
@@ -69,6 +69,7 @@ module PipeDrive
69
69
 
70
70
  begin
71
71
  body = JSON.parse(response.body)
72
+ body = {body: body} unless body.is_a?(Hash)
72
73
  rescue
73
74
  body = {body: response.body}
74
75
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pipe_drive_ruby_wrapper
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - JiaRou Lee
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-09-04 00:00:00.000000000 Z
11
+ date: 2018-09-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec