Class: Paperform::PartialSubmission
- Inherits:
-
Object
- Object
- Paperform::PartialSubmission
- Defined in:
- lib/paperform/partial_submission.rb
Constant Summary collapse
- BASE_URL =
'https://api.paperform.co/v1/partial-submissions'
Instance Attribute Summary collapse
-
#token ⇒ Object
readonly
Returns the value of attribute token.
Instance Method Summary collapse
- #find(id) ⇒ Object
-
#initialize(token) ⇒ PartialSubmission
constructor
A new instance of PartialSubmission.
- #list(form_id, options = nil) ⇒ Object
Constructor Details
#initialize(token) ⇒ PartialSubmission
Returns a new instance of PartialSubmission.
7 8 9 |
# File 'lib/paperform/partial_submission.rb', line 7 def initialize(token) @token = token end |
Instance Attribute Details
#token ⇒ Object (readonly)
Returns the value of attribute token.
3 4 5 |
# File 'lib/paperform/partial_submission.rb', line 3 def token @token end |
Instance Method Details
#find(id) ⇒ Object
11 12 13 14 15 16 17 18 19 |
# File 'lib/paperform/partial_submission.rb', line 11 def find(id) params = { id: id } response = Curl.get(BASE_URL, params) do |http| http.headers['Authorization'] = "Bearer #{token}" end response.body end |
#list(form_id, options = nil) ⇒ Object
21 22 23 24 25 26 27 28 29 30 |
# File 'lib/paperform/partial_submission.rb', line 21 def list(form_id, = nil) params = { form: form_id } params.merge!() if response = Curl.get(BASE_URL, params) do |http| http.headers['Authorization'] = "Bearer #{token}" end response.body end |