Module: Convertkit::Client::CustomFields

Included in:
Convertkit::Client
Defined in:
lib/convertkit/client/custom_fields.rb

Instance Method Summary collapse

Instance Method Details

#add_custom_field(options = {}) ⇒ Object



9
10
11
12
13
# File 'lib/convertkit/client/custom_fields.rb', line 9

def add_custom_field(options = {})
  connection.post("custom_fields") do |f|
    f.params['label'] = options[:label]
  end
end

#custom_fieldsObject



5
6
7
# File 'lib/convertkit/client/custom_fields.rb', line 5

def custom_fields
  connection.get("custom_fields").body["custom_fields"]
end

#delete_custom_field(custom_field_id) ⇒ Object



15
16
17
# File 'lib/convertkit/client/custom_fields.rb', line 15

def delete_custom_field(custom_field_id)
  connection.delete("custom_fields/#{custom_field_id}")
end

#update_custom_field(custom_field_id, options = {}) ⇒ Object



19
20
21
22
23
# File 'lib/convertkit/client/custom_fields.rb', line 19

def update_custom_field(custom_field_id, options = {})
  connection.put("custom_fields/#{custom_field_id}") do |f|
    f.params['label'] = options[:label]
  end
end