Class: Fountain::Api::Funnels
- Inherits:
-
Object
- Object
- Fountain::Api::Funnels
- Extended by:
- RequestHelper
- Defined in:
- lib/fountain/api/funnels.rb
Overview
Fountain Funnel Management API
Constant Summary
Constants included from RequestHelper
RequestHelper::DEFAULT_REQUEST_OPTIONS
Class Method Summary collapse
-
.get(funnel_id) ⇒ Fountain::Funnel
Get Funnel Info.
-
.list(list_options = {}) ⇒ Fountain::Funnels
List all Funnels.
-
.list_stages(funnel_id) ⇒ [Fountain::Stage]
List all Funnel stages.
-
.update(funnel_id, update_options = {}) ⇒ Fountain::Funnel
Update Funnel.
Methods included from RequestHelper
Class Method Details
.get(funnel_id) ⇒ Fountain::Funnel
Get Funnel Info
25 26 27 28 |
# File 'lib/fountain/api/funnels.rb', line 25 def self.get(funnel_id) response = request_json("/v2/funnels/#{funnel_id}") Fountain::Funnel.new response end |
.list(list_options = {}) ⇒ Fountain::Funnels
List all Funnels
15 16 17 18 19 |
# File 'lib/fountain/api/funnels.rb', line 15 def self.list( = {}) page_query = [:page] ? "?page=#{[:page]}" : '' response = request_json("/v2/funnels#{page_query}") Fountain::Funnels.new response end |
.list_stages(funnel_id) ⇒ [Fountain::Stage]
List all Funnel stages
49 50 51 52 |
# File 'lib/fountain/api/funnels.rb', line 49 def self.list_stages(funnel_id) response = request_json("/v2/funnels/#{funnel_id}/stages") response['stages'].map { |hash| Fountain::Stage.new hash } end |
.update(funnel_id, update_options = {}) ⇒ Fountain::Funnel
Update Funnel
36 37 38 39 40 41 42 43 |
# File 'lib/fountain/api/funnels.rb', line 36 def self.update(funnel_id, = {}) response = request_json( "/v2/funnels/#{funnel_id}", method: :put, body: Util.slice_hash(, :custom_id) ) Fountain::Funnel.new response end |