Class: BaseCRM::VisitOutcomesService
- Inherits:
-
Object
- Object
- BaseCRM::VisitOutcomesService
- Defined in:
- lib/basecrm/services/visit_outcomes_service.rb
Instance Method Summary collapse
-
#all ⇒ Enumerable
Retrieve visit outcomes.
-
#initialize(client) ⇒ VisitOutcomesService
constructor
A new instance of VisitOutcomesService.
-
#where(options = {}) ⇒ Array<VisitOutcome>
Retrieve visit outcomes.
Constructor Details
#initialize(client) ⇒ VisitOutcomesService
Returns a new instance of VisitOutcomesService.
5 6 7 |
# File 'lib/basecrm/services/visit_outcomes_service.rb', line 5 def initialize(client) @client = client end |
Instance Method Details
#all ⇒ Enumerable
Retrieve visit outcomes
get ‘/visit_outcomes’
If you want to use filtering or sorting (see #where).
15 16 17 |
# File 'lib/basecrm/services/visit_outcomes_service.rb', line 15 def all PaginatedResource.new(self) end |
#where(options = {}) ⇒ Array<VisitOutcome>
Retrieve visit outcomes
get ‘/visit_outcomes’
Returns Visit Outcomes, according to the parameters provided
29 30 31 32 33 |
# File 'lib/basecrm/services/visit_outcomes_service.rb', line 29 def where( = {}) _, _, root = @client.get("/visit_outcomes", ) root[:items].map{ |item| VisitOutcome.new(item[:data]) } end |