Skip to content

Commit 9cccbed

Browse files
committed
Remove Intercom::UserCollectionProxy#count (clashes with Enumerable#count)
1 parent 557021b commit 9cccbed

File tree

2 files changed

+0
-14
lines changed

2 files changed

+0
-14
lines changed

lib/intercom/user_collection_proxy.rb

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,12 @@ module Intercom
88
#
99
# == Examples:
1010
#
11-
# Fetching a count of all Users tracked on Intercom
12-
# Intercom::User.all.count
13-
#
1411
# Iterating over each user
1512
# Intercom::User.all.each do |user|
1613
# puts user.inspect
1714
# end
1815
#
1916
class UserCollectionProxy
20-
# @return [Integer] number of users tracked on Intercom for this application
21-
def count
22-
response = Intercom.get("/v1/users", {:per_page => 1})
23-
response["total_count"]
24-
end
25-
2617
# yields each {User} to the block provided
2718
# @return [void]
2819
def each(&block)

spec/unit/intercom/user_collection_proxy_spec.rb

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,6 @@
1818
Intercom::User.all.collect { |user| user.email }.must_equal %W(user1@example.com user2@example.com user3@example.com)
1919
end
2020

21-
it "yields each user to the block" do
22-
Intercom.expects(:get).with("/v1/users", {:per_page => 1}).returns(page_of_users(1,1))
23-
Intercom::User.all.count.must_equal 3
24-
end
25-
2621
it "loads multiple pages" do
2722
Intercom.expects(:get).with("/v1/users", {:page => 1}).returns(page_of_users(1, 1))
2823
Intercom.expects(:get).with("/v1/users", {:page => 2}).returns(page_of_users(2, 1))

0 commit comments

Comments
 (0)