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