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 +4 -4
- data/README.md +4 -1
- data/changes.txt +3 -0
- data/lib/intercom/service/contact.rb +4 -1
- data/lib/intercom/service/user.rb +4 -4
- data/lib/intercom/version.rb +1 -1
- data/spec/unit/intercom/contact_spec.rb +13 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e53226896c0af5b1288ba4fa3ccd42d36a97acb9
|
4
|
+
data.tar.gz: 6836b82a65fe0dc6e7da27cabbaa5047f9c89f5b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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.
|
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
|
data/changes.txt
CHANGED
@@ -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
|
data/lib/intercom/version.rb
CHANGED
@@ -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
|