Class: BaseCRM::CallOutcomesService
- Inherits:
-
Object
- Object
- BaseCRM::CallOutcomesService
- Defined in:
- lib/basecrm/services/call_outcomes_service.rb
Instance Method Summary collapse
-
#all ⇒ Enumerable
Retrieve all call outcomes.
-
#initialize(client) ⇒ CallOutcomesService
constructor
A new instance of CallOutcomesService.
-
#where(options = {}) ⇒ Array<CallOutcome>
Retrieve all call outcomes.
Constructor Details
#initialize(client) ⇒ CallOutcomesService
Returns a new instance of CallOutcomesService.
5 6 7 |
# File 'lib/basecrm/services/call_outcomes_service.rb', line 5 def initialize(client) @client = client end |
Instance Method Details
#all ⇒ Enumerable
Retrieve all call outcomes
get ‘/call_outcomes’
If you want to use filtering or sorting (see #where).
15 16 17 |
# File 'lib/basecrm/services/call_outcomes_service.rb', line 15 def all PaginatedResource.new(self) end |
#where(options = {}) ⇒ Array<CallOutcome>
Retrieve all call outcomes
get ‘/call_outcomes’
Returns all call outcomes available to the user, according to the parameters provided Call outcomes are always sorted by id in ascending order
30 31 32 33 34 |
# File 'lib/basecrm/services/call_outcomes_service.rb', line 30 def where( = {}) _, _, root = @client.get("/call_outcomes", ) root[:items].map{ |item| CallOutcome.new(item[:data]) } end |