Class: ActiveCampaignWrapper::Core::CustomFieldOptionGateway

Inherits:
Object
  • Object
show all
Defined in:
lib/active_campaign_wrapper/core/custom_field_option_gateway.rb

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ CustomFieldOptionGateway

Returns a new instance of CustomFieldOptionGateway.



6
7
8
9
# File 'lib/active_campaign_wrapper/core/custom_field_option_gateway.rb', line 6

def initialize(client)
  @client = client
  @config = client.config
end

Instance Method Details

#create(params) ⇒ Object



11
12
13
14
15
16
17
18
19
# File 'lib/active_campaign_wrapper/core/custom_field_option_gateway.rb', line 11

def create(params)
  params = { field_options: params }
  @config.post(
    '/fieldOption/bulk',
    body: ActiveCampaignWrapper::Helpers.normalize_body(
      params
    )
  )
end

#delete(field_option_id) ⇒ Object



25
26
27
# File 'lib/active_campaign_wrapper/core/custom_field_option_gateway.rb', line 25

def delete(field_option_id)
  @config.delete("/fieldOptions/#{field_option_id}")
end

#find(field_option_id) ⇒ Object



21
22
23
# File 'lib/active_campaign_wrapper/core/custom_field_option_gateway.rb', line 21

def find(field_option_id)
  @config.get("/fieldOptions/#{field_option_id}")
end