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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5110cc550072f76df8878bc01d5ae52713792ac7
4
- data.tar.gz: 24ce0af5e5b1abd006748327dacca2119285b6c6
3
+ metadata.gz: f2968a8daa352305b8c7b2f56defb9b94762fac0
4
+ data.tar.gz: eef8b22588e52cf18ef2a209b0d096783fe2a07e
5
5
  SHA512:
6
- metadata.gz: 802a609a8cb9c6a7754c87a2a42553717918eb65cd0494e8da858f96e597ff419677a53aaeaafa7e8cf80fcb85587021581634f9ad9f5a576026e01ed67d8cb5
7
- data.tar.gz: 874a3afb3edd697a352a6a8f16c3ec45d0e7e098286953530a47496b68267ed355f5ec0d372ff84b563bbb7d0d9d30f538f6689899a4d83f923b6d33aa1ad5a9
6
+ metadata.gz: 6d914f944a26960af0232c7e433aba840543659a08048b52dbe8d0b06370d810c03e4a0c221962eae0881341433f3f3a7c977bc47e6cb1a34dfcac9d8f11b7b6
7
+ data.tar.gz: 457d912fa47ba223f2aca662df973a7299cea9d3212bf3c9f64306b0ed1857f2d99c15d1a197b86c095a277b761d66b85332a96f01c05d188146d22c495e1497
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.3"
25
+ gem 'intercom', "~> 3.0.4"
26
26
 
27
27
  ## Basic Usage
28
28
 
data/changes.txt CHANGED
@@ -1,3 +1,6 @@
1
+ 3.0.4
2
+ - Support the `all` resource on Contacts
3
+
1
4
  3.0.3
2
5
  - Fix untagging
3
6
 
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'
@@ -8,6 +8,7 @@ require 'intercom/api_operations/convert'
8
8
  module Intercom
9
9
  module Service
10
10
  class Contact < BaseService
11
+ include ApiOperations::List
11
12
  include ApiOperations::Load
12
13
  include ApiOperations::Find
13
14
  include ApiOperations::FindAll
@@ -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
@@ -1,3 +1,3 @@
1
1
  module Intercom #:nodoc:
2
- VERSION = "3.0.3"
2
+ VERSION = "3.0.4"
3
3
  end
@@ -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.3
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-08 00:00:00.000000000 Z
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