From af2b0a3f060f297ed15699d4d5990048fd332085 Mon Sep 17 00:00:00 2001 From: Nate Gadgibalaev Date: Sat, 4 Apr 2015 14:59:44 +0300 Subject: [PATCH] Implemened #destroy --- lib/pipedrive/base.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/pipedrive/base.rb b/lib/pipedrive/base.rb index 9a0adb0..82825f7 100644 --- a/lib/pipedrive/base.rb +++ b/lib/pipedrive/base.rb @@ -117,6 +117,11 @@ def find_by_name(name, opts={}) res = get "#{resource_path}/find", :query => { :term => name }.merge(opts) res.ok? ? new_list(res) : bad_response(res,{:name => name}.merge(opts)) end + + def destroy + res = delete "#{resource_path}/#{id}" + res.ok? ? res : bad_response(res, attrs) + end def resource_path # The resource path should match the camelCased class name with the