intercom 3.5.2 → 3.5.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d85b66c4f019a0f8c063d8110ac924ac77d1795a
4
- data.tar.gz: 546be6dc3600a8adae3e671e32fd37f8dd2cf38f
3
+ metadata.gz: 2cb77431bc9d029fc727badd60a0ff01a015646d
4
+ data.tar.gz: 4e29db4fae3a6d8451bd35fc4ab63fc3bf97d39c
5
5
  SHA512:
6
- metadata.gz: 672212ab75756e91d0cf82c38b07c3a7eb2acee1e92715d2d0e4181bc527099cce3bf0e0fc828a619124a0db7d309c6e92677f067ca814a35d90b4cf5ea1390e
7
- data.tar.gz: 7044d4fa88f2ca8ce4fd53230595a473a3770aa480e9952d0a15753a38027edcfe04cb3b0b0513b4affeb212ace7f36b18499bb30d463b3364b56db0077cd890
6
+ metadata.gz: b2c07f366f514edbc42ca1fdfe75f568eda7b7b8cd1ba7737d29503474e875c98c01d2288df14d2ab6ad8f6557f77ade20bea102793a8487cfc64348fb607244
7
+ data.tar.gz: 1d13a52bc103466aa225e0bda5426ff54b6294c6d5a303f302f84430732857f61ec6df572ba46d7b49a393fd804dace30b1bf9d0a8bb14eb6ca2948a56787b05
data/README.md CHANGED
@@ -1,8 +1,8 @@
1
1
  # intercom-ruby
2
2
 
3
- Ruby bindings for the Intercom API (https://api.intercom.io).
3
+ Ruby bindings for the Intercom API (https://developers.intercom.io/reference).
4
4
 
5
- [API Documentation](https://api.intercom.io/docs)
5
+ [API Documentation](https://developers.intercom.io/docs)
6
6
 
7
7
  [Gem Documentation](http://rubydoc.info/github/intercom/intercom-ruby/master/frames)
8
8
 
@@ -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.5.1"
25
+ gem 'intercom', "~> 3.5.2"
26
26
 
27
27
  ## Basic Usage
28
28
 
@@ -240,7 +240,7 @@ intercom.messages.create({
240
240
  },
241
241
  :to => {
242
242
  :type => "user",
243
- :id => "5678"
243
+ :user_id => "5678"
244
244
  }
245
245
  })
246
246
 
@@ -1,3 +1,6 @@
1
+ 3.5.3
2
+ - Add support for global conversation counts
3
+
1
4
  3.5.2
2
5
  - Add Support for pagination
3
6
 
@@ -15,7 +15,9 @@ module Intercom
15
15
  end
16
16
 
17
17
  def for_type(type:, count: nil)
18
- find(type: type, count: count)
18
+ params = {type: type}
19
+ params[:count] = count if count
20
+ find(params)
19
21
  end
20
22
  end
21
23
  end
@@ -1,3 +1,3 @@
1
1
  module Intercom #:nodoc:
2
- VERSION = "3.5.2"
2
+ VERSION = "3.5.3"
3
3
  end
@@ -520,6 +520,18 @@ def test_segment_count
520
520
  }
521
521
  end
522
522
 
523
+ def test_conversation_count
524
+ {
525
+ "type" => "count",
526
+ "conversation" => {
527
+ "assigned" => 1,
528
+ "closed" => 15,
529
+ "open" => 1,
530
+ "unassigned" => 0
531
+ }
532
+ }
533
+ end
534
+
523
535
  def error_on_modify_frozen
524
536
  RUBY_VERSION =~ /1.8/ ? TypeError : RuntimeError
525
537
  end
@@ -14,4 +14,15 @@ describe "Intercom::Count" do
14
14
  counts = client.counts.for_type(type: 'user', count: 'segment')
15
15
  counts.user['segment'][4]["segment 1"].must_equal(1)
16
16
  end
17
+
18
+ it 'should not include count param when nil' do
19
+ client.expects(:get).with("/counts", {type: 'conversation'}).returns(test_conversation_count)
20
+ counts = client.counts.for_type(type: 'conversation')
21
+ counts.conversation.must_equal({
22
+ "assigned" => 1,
23
+ "closed" => 15,
24
+ "open" => 1,
25
+ "unassigned" => 0
26
+ })
27
+ end
17
28
  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.5.2
4
+ version: 3.5.3
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: 2016-07-08 00:00:00.000000000 Z
18
+ date: 2016-08-25 00:00:00.000000000 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: minitest