intercom 3.0.5 → 3.0.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
  SHA1:
3
- metadata.gz: 515802ff1485e49789659e0f6e8ff7a97991efef
4
- data.tar.gz: f9b1670d919cf0051ae235fc48da54cc06ed8bcd
3
+ metadata.gz: e53226896c0af5b1288ba4fa3ccd42d36a97acb9
4
+ data.tar.gz: 6836b82a65fe0dc6e7da27cabbaa5047f9c89f5b
5
5
  SHA512:
6
- metadata.gz: d4358b8c0ca1294f01d5cf515bdd70ff14ffc3afb2a0d55d5d37f0eaa4d63a6ca116ff3b84b33b8bc738aa1fe4c0fbfa4cb2279748b363ded3e36f4ddd585dce
7
- data.tar.gz: ea2adc6ea9b836d671a43e27b0e116c9a9ac6b8fcad56c7dcb6fcbcb45904ab64ce72733e1d9b629cd86a151c415a97f59906932ce3eb28888aa330026be54f2
6
+ metadata.gz: 3440e69c84ec64f96921ac763b7751fce79671bae34d0bcbee80a65942890e2d6fb9fd80959285131e3c79460af611ccea42e1bcff30562b2d90373b16de1ee1
7
+ data.tar.gz: 17d9779094ab97f45787ac590c1a18708c7075201990e60d91c7691fbe8a5d16466fc7ada2e32066c6cf715877e394f13bb23f0a312b5a5a3d2151aa945e5959
data/README.md CHANGED
@@ -22,7 +22,7 @@ This version of the gem is compatible with `Ruby 2.1` and above.
22
22
 
23
23
  Using bundler:
24
24
 
25
- gem 'intercom', "~> 3.0.5"
25
+ gem 'intercom', "~> 3.0.6"
26
26
 
27
27
  ## Basic Usage
28
28
 
@@ -313,6 +313,9 @@ contacts = intercom.contacts.find_all(email: "some_contact@example.com")
313
313
 
314
314
  # Convert a contact into a user
315
315
  intercom.contacts.convert(contact, user)
316
+
317
+ # Delete a contact
318
+ intercom.contacts.find(id: "some_id").delete
316
319
  ```
317
320
 
318
321
  ### Counts
@@ -1,3 +1,6 @@
1
+ 3.0.6
2
+ - Support the `delete` resource on Contacts
3
+
1
4
  3.0.5
2
5
  - Fix id-based updates on Contacts (thanks @gevans)
3
6
 
@@ -1,19 +1,22 @@
1
1
  require 'intercom/service/base_service'
2
2
  require 'intercom/api_operations/load'
3
+ require 'intercom/api_operations/list'
3
4
  require 'intercom/api_operations/find'
4
5
  require 'intercom/api_operations/find_all'
5
6
  require 'intercom/api_operations/save'
6
7
  require 'intercom/api_operations/convert'
8
+ require 'intercom/api_operations/delete'
7
9
 
8
10
  module Intercom
9
11
  module Service
10
12
  class Contact < BaseService
11
- include ApiOperations::List
12
13
  include ApiOperations::Load
14
+ include ApiOperations::List
13
15
  include ApiOperations::Find
14
16
  include ApiOperations::FindAll
15
17
  include ApiOperations::Save
16
18
  include ApiOperations::Convert
19
+ include ApiOperations::Delete
17
20
 
18
21
  def collection_class
19
22
  Intercom::Contact
@@ -1,5 +1,3 @@
1
- require 'intercom/extended_api_operations/tags'
2
- require 'intercom/extended_api_operations/segments'
3
1
  require 'intercom/service/base_service'
4
2
  require 'intercom/api_operations/load'
5
3
  require 'intercom/api_operations/list'
@@ -7,14 +5,16 @@ require 'intercom/api_operations/find'
7
5
  require 'intercom/api_operations/find_all'
8
6
  require 'intercom/api_operations/save'
9
7
  require 'intercom/api_operations/delete'
8
+ require 'intercom/extended_api_operations/tags'
9
+ require 'intercom/extended_api_operations/segments'
10
10
 
11
11
  module Intercom
12
12
  module Service
13
13
  class User < BaseService
14
- include ApiOperations::Find
15
- include ApiOperations::FindAll
16
14
  include ApiOperations::Load
17
15
  include ApiOperations::List
16
+ include ApiOperations::Find
17
+ include ApiOperations::FindAll
18
18
  include ApiOperations::Save
19
19
  include ApiOperations::Delete
20
20
  include ExtendedApiOperations::Tags
@@ -1,3 +1,3 @@
1
1
  module Intercom #:nodoc:
2
- VERSION = "3.0.5"
2
+ VERSION = "3.0.6"
3
3
  end
@@ -37,4 +37,17 @@ describe "Intercom::Contact" do
37
37
  client.contacts.convert(contact, user)
38
38
  end
39
39
  end
40
+
41
+ it "returns a ClientCollectionProxy for all without making any requests" do
42
+ client.expects(:execute_request).never
43
+ all = client.contacts.all
44
+ all.must_be_instance_of(Intercom::ClientCollectionProxy)
45
+ end
46
+
47
+ it "deletes a contact" do
48
+ contact = Intercom::Contact.new("id" => "1")
49
+ client.expects(:delete).with("/contacts/1", {}).returns(contact)
50
+ client.contacts.delete(contact)
51
+ end
52
+
40
53
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: intercom
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.5
4
+ version: 3.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ben McRedmond