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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5ad60a48189a843b3116774beae036174e1b606ff5b7be8e8ad65e08a5a94b7f
4
- data.tar.gz: ca6fa882e2fa9f2bef9aa1753f1df168259d0aed49f316cd22bb7cb24f92aa37
3
+ metadata.gz: e363d8b04b4054609edf5c8e22598b3c6a86a04f0e749f4b25bd78b731960259
4
+ data.tar.gz: dc9862112d51ab6548238d9169ec9107115ca95d133a33c5ce44e369a4d11e9d
5
5
  SHA512:
6
- metadata.gz: 0e3abe87d14de60e671bdf88cd6eade2ce65ea1152826de892596ecc22ec4724c80679771978e87aed72125b2be3944edde0e21ab7680293dfd57c0a4678d1b7
7
- data.tar.gz: 126bd9432699a6cd954c770f91c41c050aff180ef0368351cba122cabcb661ef864bb9d4dffb7b07fbc56c4b0128fd5787e9ecaba28cccfa8d83dca98f08c99d
6
+ metadata.gz: 2c10a51687e5a8c06deed0034a90972ad0bf3f09c09dac034566fb8475eb7cdbd7996027d8ead0ce78be2d8f0af47d1f4017dae38c4f99c7ee6fe74da1c7f2f0
7
+ data.tar.gz: e064a89db1bad77d3bff769598c587649621e488e173cbec29664831d43a024c4ded3200d97cf8ba4be314bf4dcd15415d8ea2f5699994a9f8defc37c4988387
@@ -1,7 +1,7 @@
1
1
  # prontoforms changelog
2
2
 
3
3
 
4
- ## [Unreleased]
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
- ## [0.2.0] - 26 Aug 2020
12
+ ## [v0.2.0] - 26 Aug 2020
13
13
  ### Bugfixes
14
14
  * Corrected pagination of resource lists
15
15
 
16
- ## [0.1.0] - 25 Aug 2020
16
+ ## [v0.1.0] - 25 Aug 2020
17
17
  * Initial release
18
18
 
19
- [Unreleased]: https://github.com/paulholden2/prontoforms/compare/v0.2.0...HEAD
20
- [0.1.0]: https://github.com/paulholden2/prontoforms/releases/tag/v0.1.0
21
- [0.2.0]: https://github.com/paulholden2/prontoforms/releases/tag/v0.2.0
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
@@ -9,10 +9,4 @@ module ProntoForms
9
9
  @message = message
10
10
  end
11
11
  end
12
-
13
- class InvalidHttpVerb < Error
14
- def initialize(verb)
15
- super("Invalid HTTP verb: #{verb}")
16
- end
17
- end
18
12
  end
@@ -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)
@@ -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
@@ -1,3 +1,3 @@
1
1
  module ProntoForms
2
- VERSION = '0.3.0'
2
+ VERSION = '0.3.1'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: prontoforms
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Paul Holden