Class: Intercom::Service::Counts

Inherits:
BaseService show all
Includes:
ApiOperations::Find
Defined in:
lib/intercom/service/count.rb

Instance Attribute Summary

Attributes inherited from BaseService

#client

Instance Method Summary collapse

Methods included from ApiOperations::Find

#find

Methods inherited from BaseService

#collection_proxy_class, #from_api, #initialize

Constructor Details

This class inherits a constructor from Intercom::Service::BaseService

Instance Method Details

#collection_classObject


9
10
11
# File 'lib/intercom/service/count.rb', line 9

def collection_class
  Intercom::Count
end

#for_appObject


13
14
15
# File 'lib/intercom/service/count.rb', line 13

def for_app
  find({})
end

#for_type(type:, count: nil) ⇒ Object


17
18
19
20
21
# File 'lib/intercom/service/count.rb', line 17

def for_type(type:, count: nil)
  params = {type: type}
  params[:count] = count if count
  find(params)
end