Class: ActionNetworkRest::Forms

Inherits:
Base
  • Object
show all
Defined in:
lib/action_network_rest/forms.rb

Instance Method Summary collapse

Methods inherited from Base

#all, #get, #list

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_pathObject



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