prontoforms 0.3.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +7 -6
- data/lib/prontoforms.rb +0 -6
- data/lib/prontoforms/form_space.rb +4 -0
- data/lib/prontoforms/form_submission.rb +4 -0
- data/lib/prontoforms/resource_list.rb +5 -0
- data/lib/prontoforms/user.rb +10 -0
- data/lib/prontoforms/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e363d8b04b4054609edf5c8e22598b3c6a86a04f0e749f4b25bd78b731960259
|
4
|
+
data.tar.gz: dc9862112d51ab6548238d9169ec9107115ca95d133a33c5ce44e369a4d11e9d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2c10a51687e5a8c06deed0034a90972ad0bf3f09c09dac034566fb8475eb7cdbd7996027d8ead0ce78be2d8f0af47d1f4017dae38c4f99c7ee6fe74da1c7f2f0
|
7
|
+
data.tar.gz: e064a89db1bad77d3bff769598c587649621e488e173cbec29664831d43a024c4ded3200d97cf8ba4be314bf4dcd15415d8ea2f5699994a9f8defc37c4988387
|
data/CHANGELOG.md
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# prontoforms changelog
|
2
2
|
|
3
3
|
|
4
|
-
## [
|
4
|
+
## [v0.3.0]
|
5
5
|
### Added
|
6
6
|
* Autogenerated documentation via YARD.
|
7
7
|
|
@@ -9,13 +9,14 @@
|
|
9
9
|
* Errors now provide a message describing the issue
|
10
10
|
* `ProntoForms::Client` now raises error on invalid resource definition.
|
11
11
|
|
12
|
-
## [
|
12
|
+
## [v0.2.0] - 26 Aug 2020
|
13
13
|
### Bugfixes
|
14
14
|
* Corrected pagination of resource lists
|
15
15
|
|
16
|
-
## [
|
16
|
+
## [v0.1.0] - 25 Aug 2020
|
17
17
|
* Initial release
|
18
18
|
|
19
|
-
[Unreleased]: https://github.com/paulholden2/prontoforms/compare/v0.
|
20
|
-
[
|
21
|
-
[
|
19
|
+
[Unreleased]: https://github.com/paulholden2/prontoforms/compare/v0.3.0...HEAD
|
20
|
+
[v0.1.0]: https://github.com/paulholden2/prontoforms/releases/tag/v0.1.0
|
21
|
+
[v0.2.0]: https://github.com/paulholden2/prontoforms/releases/tag/v0.2.0
|
22
|
+
[v0.3.0]: https://github.com/paulholden2/prontoforms/releases/tag/v0.3.0
|
data/lib/prontoforms.rb
CHANGED
@@ -2,9 +2,13 @@ require 'prontoforms/resource'
|
|
2
2
|
|
3
3
|
module ProntoForms
|
4
4
|
class FormSpace < Resource
|
5
|
+
# @return [String] The FormSpace identifier
|
5
6
|
property :id, key: 'identifier'
|
7
|
+
# @return [String] The FormSpace name
|
6
8
|
property :name, key: 'name'
|
9
|
+
# @return [String] The address that error emails are sent to
|
7
10
|
property :problem_contact_email, key: 'problemContactEmail'
|
11
|
+
# @return [Boolean] Whether updates are automatically pushed to devices
|
8
12
|
property :push_updates_to_device, key: 'pushUpdatesToDevice'
|
9
13
|
end
|
10
14
|
end
|
@@ -25,10 +25,14 @@ module ProntoForms
|
|
25
25
|
str.nil? ? nil : DateTime.strptime(str)
|
26
26
|
end
|
27
27
|
|
28
|
+
# Retrieve the pages containing the form questions and answers
|
29
|
+
# @return [Hash] Hash of questions and answers for the FormSubmission
|
28
30
|
def pages
|
29
31
|
document.fetch('pages')
|
30
32
|
end
|
31
33
|
|
34
|
+
# Retrieve the dispatching User, if the form was dispatched
|
35
|
+
# @return [User] The user that dispatched the form, or nil
|
32
36
|
def dispatcher
|
33
37
|
client.user(document.dig('dispatcher', 'identifier'))
|
34
38
|
end
|
@@ -11,10 +11,15 @@ module ProntoForms
|
|
11
11
|
@resource = resource
|
12
12
|
end
|
13
13
|
|
14
|
+
# Retrieve the next page of results, using the same number of items per
|
15
|
+
# page as the original request.
|
16
|
+
# @return [ResourceList] A ResourceList with the next set of results
|
14
17
|
def next
|
15
18
|
client.send(method, query: query.merge({ 'p' => query['p'] + 1}))
|
16
19
|
end
|
17
20
|
|
21
|
+
# Retrieve the result set
|
22
|
+
# @return [Array] Array of resource objects
|
18
23
|
def items
|
19
24
|
@data.fetch('pageData').map { |item|
|
20
25
|
resource.new(item, client, parent)
|
data/lib/prontoforms/user.rb
CHANGED
@@ -4,14 +4,24 @@ module ProntoForms
|
|
4
4
|
class User < Resource
|
5
5
|
def self.resource_name() 'users'; end
|
6
6
|
|
7
|
+
# @return [String] The User identifier
|
7
8
|
property :id, key: 'identifier'
|
9
|
+
# @return [String] The user's username
|
8
10
|
property :username, key: 'username'
|
11
|
+
# @return [String] The user's role
|
9
12
|
property :role, key: 'role'
|
13
|
+
# @return [String] The user's email address
|
10
14
|
property :email, key: 'email'
|
15
|
+
# @return [String] The user's first name
|
11
16
|
property :first_name, key: 'firstName'
|
17
|
+
# @return [String] The user's last name
|
12
18
|
property :last_name, key: 'lastName'
|
19
|
+
# @return [String] The user's preferred locale
|
13
20
|
property :locale, key: 'locale'
|
14
21
|
|
22
|
+
# Get a display name consisting of the first name followed by last name
|
23
|
+
# e.g. "John Doe"
|
24
|
+
# @return [String] The display name for the user
|
15
25
|
def display_name
|
16
26
|
"#{first_name} #{last_name}"
|
17
27
|
end
|
data/lib/prontoforms/version.rb
CHANGED