base-api-io 1.5.0 → 1.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +10 -0
- data/lib/base/endpoints/forms.rb +25 -0
- data/lib/base/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dc018be85c12f154324392a986ee8206538ad1dc525cb7baa09084d8b61f84cc
|
4
|
+
data.tar.gz: a09e6e7c4dd8a91890f3865143865312dacd6e5935c107a2c460a0178a427b07
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0ab9d381e5f385684d01df7809d14a7b08aa799a417c7a78873ea476a973a87a658b39766b79d784e4828c18ba69e5ac0bccf550f423763ff2a3c9a72da63fa3
|
7
|
+
data.tar.gz: db37ea3fb7d4f603bc61c073dd1f4a5fc1ed43bdaa4db340175825c8726389f990722ae1474900854db61b9047452e080d9317ff1894bebcba0f8a8f4d10d441
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -279,6 +279,16 @@ submissions.metadata # The metadata object containing the total count
|
|
279
279
|
submission =
|
280
280
|
client.forms.get_submission('form_id', 'submission_id')
|
281
281
|
|
282
|
+
# Update a submission
|
283
|
+
submission =
|
284
|
+
client.forms.update_submission(
|
285
|
+
submission_id: 'submission_id',
|
286
|
+
id: 'form_id',
|
287
|
+
form: {
|
288
|
+
file: File.open('description.txt'),
|
289
|
+
key: 'value'
|
290
|
+
})
|
291
|
+
|
282
292
|
# Delete a submission
|
283
293
|
submission =
|
284
294
|
client.forms.delete_submission('form_id', 'submission_id')
|
data/lib/base/endpoints/forms.rb
CHANGED
@@ -97,6 +97,31 @@ module Base
|
|
97
97
|
end
|
98
98
|
end
|
99
99
|
|
100
|
+
# Submits a new submission for the form with the given ID.
|
101
|
+
def update_submission(id:, submission_id:, form:)
|
102
|
+
request do
|
103
|
+
payload =
|
104
|
+
form.each_with_object({}) do |(key, value), memo|
|
105
|
+
memo[key] =
|
106
|
+
case value
|
107
|
+
when File, Tempfile
|
108
|
+
Faraday::UploadIO.new(
|
109
|
+
value.path,
|
110
|
+
File.mime_type?(value),
|
111
|
+
File.basename(value)
|
112
|
+
)
|
113
|
+
else
|
114
|
+
value
|
115
|
+
end
|
116
|
+
end
|
117
|
+
|
118
|
+
response =
|
119
|
+
connection.put("#{id}/submit/#{submission_id}", payload)
|
120
|
+
|
121
|
+
parse(response.body)
|
122
|
+
end
|
123
|
+
end
|
124
|
+
|
100
125
|
# Deletes the submission with the given ID of the form with the given ID.
|
101
126
|
def delete_submission(id, submission_id)
|
102
127
|
request do
|
data/lib/base/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: base-api-io
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gusztáv Szikszai
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-12-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|