Class: BaseCRM::StagesService
- Inherits:
-
Object
- Object
- BaseCRM::StagesService
- Defined in:
- lib/basecrm/services/stages_service.rb
Instance Method Summary collapse
-
#all ⇒ Enumerable
Retrieve all stages.
-
#initialize(client) ⇒ StagesService
constructor
A new instance of StagesService.
-
#where(options = {}) ⇒ Array<Stage>
Retrieve all stages.
Constructor Details
#initialize(client) ⇒ StagesService
Returns a new instance of StagesService.
5 6 7 |
# File 'lib/basecrm/services/stages_service.rb', line 5 def initialize(client) @client = client end |
Instance Method Details
#all ⇒ Enumerable
Retrieve all stages
get ‘/stages’
If you want to use filtering or sorting (see #where).
15 16 17 |
# File 'lib/basecrm/services/stages_service.rb', line 15 def all PaginatedResource.new(self) end |
#where(options = {}) ⇒ Array<Stage>
Retrieve all stages
get ‘/stages’
Returns all stages available to the user, according to the parameters provided
34 35 36 37 38 |
# File 'lib/basecrm/services/stages_service.rb', line 34 def where( = {}) _, _, root = @client.get("/stages", ) root[:items].map{ |item| Stage.new(item[:data]) } end |