class Fountain::Api::Funnels

Fountain Funnel Management API

Public Class Methods

list(list_options = {}) click to toggle source

List all Funnels @param [Hash] list_options A hash of options when listing funnels @return [Fountain::Funnels]

# File lib/fountain/api/funnels.rb, line 15
def self.list(list_options = {})
  page_query = list_options[:page] ? "?page=#{list_options[:page]}" : ''
  response = request_json("/v2/funnels#{page_query}")
  Fountain::Funnels.new response
end
list_stages(funnel_id) click to toggle source

List all Funnel stages @param [String] funnel_id ID of the Fountain funnel @return [[Fountain::Stage]]

# File lib/fountain/api/funnels.rb, line 40
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 = {}) click to toggle source

Update Funnel @param [String] funnel_id ID of the Fountain funnel @param [Hash] update_options A hash of options when updating a funnel

custom_id

@return [Fountain::Funnel]

# File lib/fountain/api/funnels.rb, line 27
def self.update(funnel_id, update_options = {})
  response = request_json(
    "/v2/funnels/#{funnel_id}",
    method: :put,
    body: Util.slice_hash(update_options, :custom_id)
  )
  Fountain::Funnel.new response
end