lib/intercom/user_collection_proxy.rb in intercom-0.0.11 vs lib/intercom/user_collection_proxy.rb in intercom-0.0.12
- old
+ new
@@ -17,20 +17,20 @@
# end
#
class UserCollectionProxy
# @return [Integer] number of users tracked on Intercom for this application
def count
- response = Intercom.get("users", {:per_page => 1})
+ response = Intercom.get("/v1/users", {:per_page => 1})
response["total_count"]
end
# yields each {User} to the block provided
# @return [void]
def each(&block)
page = 1
fetch_another_page = true
while fetch_another_page
- current_page = Intercom.get("users", {:page => page})
+ current_page = Intercom.get("/v1/users", {:page => page})
current_page["users"].each do |user|
block.call User.from_api(user)
end
page = page + 1
fetch_another_page = !current_page["next_page"].nil?