intercom 3.0.3 → 3.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/changes.txt +3 -0
- data/intercom.gemspec +1 -0
- data/lib/intercom/client_collection_proxy.rb +1 -3
- data/lib/intercom/service/contact.rb +1 -0
- data/lib/intercom/service/tag.rb +2 -2
- data/lib/intercom/version.rb +1 -1
- data/spec/unit/intercom/contact_spec.rb +7 -0
- metadata +16 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f2968a8daa352305b8c7b2f56defb9b94762fac0
|
4
|
+
data.tar.gz: eef8b22588e52cf18ef2a209b0d096783fe2a07e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6d914f944a26960af0232c7e433aba840543659a08048b52dbe8d0b06370d810c03e4a0c221962eae0881341433f3f3a7c977bc47e6cb1a34dfcac9d8f11b7b6
|
7
|
+
data.tar.gz: 457d912fa47ba223f2aca662df973a7299cea9d3212bf3c9f64306b0ed1857f2d99c15d1a197b86c095a277b761d66b85332a96f01c05d188146d22c495e1497
|
data/README.md
CHANGED
data/changes.txt
CHANGED
data/intercom.gemspec
CHANGED
@@ -23,6 +23,7 @@ Gem::Specification.new do |spec|
|
|
23
23
|
spec.add_development_dependency 'rake', '~> 10.3'
|
24
24
|
spec.add_development_dependency 'mocha', '~> 1.0'
|
25
25
|
spec.add_development_dependency "fakeweb", ["~> 1.3"]
|
26
|
+
spec.add_development_dependency "pry"
|
26
27
|
|
27
28
|
spec.add_dependency 'json', '~> 1.8'
|
28
29
|
spec.required_ruby_version = '>= 2.1.0'
|
@@ -4,7 +4,7 @@ require "ext/sliceable_hash"
|
|
4
4
|
module Intercom
|
5
5
|
class ClientCollectionProxy
|
6
6
|
|
7
|
-
attr_reader :resource_name
|
7
|
+
attr_reader :resource_name, :finder_url, :resource_class
|
8
8
|
|
9
9
|
def initialize(resource_name, finder_details: {}, client:)
|
10
10
|
@resource_name = resource_name
|
@@ -41,8 +41,6 @@ module Intercom
|
|
41
41
|
|
42
42
|
private
|
43
43
|
|
44
|
-
def resource_class; @resource_class; end
|
45
|
-
|
46
44
|
def deserialize_response_hash(response_hash, block)
|
47
45
|
top_level_type = response_hash.delete('type')
|
48
46
|
if resource_name == 'subscriptions'
|
data/lib/intercom/service/tag.rb
CHANGED
@@ -23,7 +23,7 @@ module Intercom
|
|
23
23
|
|
24
24
|
def untag(params)
|
25
25
|
params['tag_or_untag'] = 'untag'
|
26
|
-
users_or_companies.each do |user_or_company|
|
26
|
+
users_or_companies(params).each do |user_or_company|
|
27
27
|
user_or_company[:untag] = true
|
28
28
|
end
|
29
29
|
create(params)
|
@@ -31,7 +31,7 @@ module Intercom
|
|
31
31
|
|
32
32
|
private
|
33
33
|
|
34
|
-
def users_or_companies
|
34
|
+
def users_or_companies(params)
|
35
35
|
params[:users] || params[:companies]
|
36
36
|
end
|
37
37
|
end
|
data/lib/intercom/version.rb
CHANGED
@@ -3,6 +3,13 @@ require "spec_helper"
|
|
3
3
|
describe "Intercom::Contact" do
|
4
4
|
let (:client) { Intercom::Client.new(app_id: 'app_id', api_key: 'api_key') }
|
5
5
|
|
6
|
+
it 'should be listable' do
|
7
|
+
proxy = client.contacts.all
|
8
|
+
proxy.resource_name.must_equal 'contacts'
|
9
|
+
proxy.finder_url.must_equal '/contacts'
|
10
|
+
proxy.resource_class.must_equal Intercom::Contact
|
11
|
+
end
|
12
|
+
|
6
13
|
it 'should not throw ArgumentErrors when there are no parameters' do
|
7
14
|
client.expects(:post)
|
8
15
|
client.contacts.create
|
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.
|
4
|
+
version: 3.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ben McRedmond
|
@@ -15,7 +15,7 @@ authors:
|
|
15
15
|
autorequire:
|
16
16
|
bindir: bin
|
17
17
|
cert_chain: []
|
18
|
-
date: 2015-07-
|
18
|
+
date: 2015-07-13 00:00:00.000000000 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
name: minitest
|
@@ -73,6 +73,20 @@ dependencies:
|
|
73
73
|
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
75
|
version: '1.3'
|
76
|
+
- !ruby/object:Gem::Dependency
|
77
|
+
name: pry
|
78
|
+
requirement: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
type: :development
|
84
|
+
prerelease: false
|
85
|
+
version_requirements: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
76
90
|
- !ruby/object:Gem::Dependency
|
77
91
|
name: json
|
78
92
|
requirement: !ruby/object:Gem::Requirement
|