Class: ActionNetworkRest::Forms
- Defined in:
- lib/action_network_rest/forms.rb
Instance Method Summary collapse
- #base_path ⇒ Object
- #create(form_data) ⇒ Object
-
#initialize(client:) ⇒ Forms
constructor
A new instance of Forms.
- #update(form_id, form_data) ⇒ Object
Methods inherited from Base
Constructor Details
#initialize(client:) ⇒ Forms
Returns a new instance of Forms.
5 6 7 |
# File 'lib/action_network_rest/forms.rb', line 5 def initialize(client:) super(client: client) end |
Instance Method Details
#base_path ⇒ Object
9 10 11 |
# File 'lib/action_network_rest/forms.rb', line 9 def base_path 'forms/' end |
#create(form_data) ⇒ Object
13 14 15 16 17 18 |
# File 'lib/action_network_rest/forms.rb', line 13 def create(form_data) post_data = form_data response = client.post_request(base_path, post_data) object_from_response(response, action_network_id_required: true) end |
#update(form_id, form_data) ⇒ Object
20 21 22 23 24 25 |
# File 'lib/action_network_rest/forms.rb', line 20 def update(form_id, form_data) put_data = form_data response = client.put_request("#{base_path}#{form_id}", put_data) object_from_response(response, action_network_id_required: true) end |