Module: Convertkit::Client::CustomFields
- Included in:
- Convertkit::Client
- Defined in:
- lib/convertkit/client/custom_fields.rb
Instance Method Summary collapse
- #add_custom_field(options = {}) ⇒ Object
- #custom_fields ⇒ Object
- #delete_custom_field(custom_field_id) ⇒ Object
- #update_custom_field(custom_field_id, options = {}) ⇒ Object
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( = {}) connection.post("custom_fields") do |f| f.params['label'] = [:label] end end |
#custom_fields ⇒ Object
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, = {}) connection.put("custom_fields/#{custom_field_id}") do |f| f.params['label'] = [:label] end end |