Class: ActionNetworkRest::Signatures
- Defined in:
- lib/action_network_rest/signatures.rb
Instance Attribute Summary collapse
-
#petition_id ⇒ Object
Returns the value of attribute petition_id.
Instance Method Summary collapse
Methods inherited from Base
Instance Attribute Details
#petition_id ⇒ Object
Returns the value of attribute petition_id.
3 4 5 |
# File 'lib/action_network_rest/signatures.rb', line 3 def petition_id @petition_id end |
Instance Method Details
#base_path ⇒ Object
5 6 7 |
# File 'lib/action_network_rest/signatures.rb', line 5 def base_path "petitions/#{url_escape(petition_id)}/signatures/" end |
#create(signature_data, tags: []) ⇒ Object
9 10 11 12 13 14 15 16 17 |
# File 'lib/action_network_rest/signatures.rb', line 9 def create(signature_data, tags: []) post_body = signature_data if .any? post_body['add_tags'] = end response = client.post_request base_path, post_body object_from_response(response) end |
#update(id, signature_data) ⇒ Object
19 20 21 22 |
# File 'lib/action_network_rest/signatures.rb', line 19 def update(id, signature_data) response = client.put_request "#{base_path}#{url_escape(id)}", signature_data object_from_response(response) end |