Class: Inkdit::FormContract
- Defined in:
- lib/inkdit/form_contract.rb
Overview
represents a form contract on Inkdit
Instance Attribute Summary
Attributes inherited from Resource
Instance Method Summary collapse
-
#content ⇒ String
The contract’s content.
-
#content_updated_at ⇒ Object
an opaque string indicating the version of the form contract’s content.
-
#name ⇒ String
A human-readable name for the contract.
-
#sign! ⇒ Signature
sign this field as the user and entity associated with the current access token.
- #signatures_link ⇒ Object
Methods inherited from Resource
#==, #fetch!, #initialize, #inspect
Constructor Details
This class inherits a constructor from Inkdit::Resource
Instance Method Details
#content ⇒ String
Returns the contract’s content.
10 11 12 |
# File 'lib/inkdit/form_contract.rb', line 10 def content @params['content'] end |
#content_updated_at ⇒ Object
an opaque string indicating the version of the form contract’s content
19 20 21 |
# File 'lib/inkdit/form_contract.rb', line 19 def content_updated_at @params['content_updated_at'] end |
#name ⇒ String
Returns a human-readable name for the contract.
5 6 7 |
# File 'lib/inkdit/form_contract.rb', line 5 def name @params['name'] end |
#sign! ⇒ Signature
sign this field as the user and entity associated with the current access token.
25 26 27 28 29 30 |
# File 'lib/inkdit/form_contract.rb', line 25 def sign! params = { :if_updated_at => self.content_updated_at } response = @client.post self.signatures_link, { :body => params.to_json, :headers => { 'Content-Type' => 'application/json' } } Inkdit::Signature.new(@client, response.parsed) end |
#signatures_link ⇒ Object
14 15 16 |
# File 'lib/inkdit/form_contract.rb', line 14 def signatures_link @params['links']['signatures'] end |