ruby_universign 1.5.1 → 1.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b7f7b34b6f2e64791dbf6910f67dc2d39fda890db4e90c0c6e20a3516a50b26e
4
- data.tar.gz: 24b47db3af2b7dd0a644649e80fc61880e06ef546909c2479d0c3b93fac7aa66
3
+ metadata.gz: 6b9f405760f5eb18d3bad2c05134f42af4d4dc9defe30639b2f1e60e93c7a223
4
+ data.tar.gz: a109b5e69cbcab3e2314f98976054543269047ee04e984ddb2847e238189c8e3
5
5
  SHA512:
6
- metadata.gz: b868fd44745e5fc5671f17977249d538a406de57c04219448eec046f7f053c5325bfdaa78ca70e0c8f4fd67fb1bcda738590725f01ba692e207ac4b0c80794d4
7
- data.tar.gz: 6a7fbc730e6687ad99fb528f638cc3b43121f5728229b634065545fedff9bc111ed487f06f71d10fbc448173e46eb77856d8363376d4e3a6d40a99af2b89e7a4
6
+ metadata.gz: 2cdb8b72105f47ad3bf4280687c37b20e8c54f3ee8b04e6a35ec799c6db2872231000ec1f3976927b313c12b795ec5387552b74470ef250ae8b69385bd230d5d
7
+ data.tar.gz: b9fac92d473ac23ddd78431ee05b29a1f4b9df8c0aa2515c5b57718caf3175b6af8aee2bbff6dee0bceb5de3e242eae8ebb430526162fc1e50575ef935b92574
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ v1.6.0
2
+ -------------------------
3
+ - Added the possibility to add required checkboxes to `Universign::Document`.
4
+
1
5
  v1.5.1
2
6
  -------------------------
3
7
  - Fix bugs on multi-threads requests.
data/README.md CHANGED
@@ -85,32 +85,47 @@ transaction = Universign::Transaction.new('9696179e-a43d-4803-beeb-9e5c02fd159b'
85
85
  transaction.signed?
86
86
  ```
87
87
 
88
- The gem also supports the updated way of creating multiple signature fields per document:
89
-
90
- ```ruby
91
- doc_1 = Universign::Document.new(
92
- name: 'one.pdf',
93
- content: File.open('spec/fixtures/universign-guide-8.8.pdf').read,
94
- signature_fields: [
95
- Universign::SignatureField.new(coordinate: [20, 20], page: 1, signer_index: 0),
96
- Universign::SignatureField.new(coordinate: [80, 20], page: 1, signer_index: 0)
97
- ]
98
- )
99
-
100
- doc_2 = Universign::Document.new(
101
- name: 'two.pdf',
102
- content: File.open('spec/fixtures/universign-guide-8.8.pdf').read,
103
- signature_fields: [
104
- Universign::SignatureField.new(coordinate: [100, 120], page: 4, signer_index: 0),
105
- ]
106
- )
107
-
108
- transaction = Universign::Transaction.create(
109
- documents: [doc_1, doc_2],
110
- signers: [signer],
111
- options: { profile: 'default', final_doc_sent: true }
112
- )
113
- ```
88
+ The gem also supports the updated way of creating multiple fields per document:
89
+
90
+ - Multiple signatures
91
+ ```ruby
92
+ doc_1 = Universign::Document.new(
93
+ name: 'one.pdf',
94
+ content: File.open('spec/fixtures/universign-guide-8.8.pdf').read,
95
+ signature_fields: [
96
+ Universign::SignatureField.new(coordinate: [20, 20], page: 1, signer_index: 0),
97
+ Universign::SignatureField.new(coordinate: [80, 20], page: 1, signer_index: 0)
98
+ ]
99
+ )
100
+
101
+ doc_2 = Universign::Document.new(
102
+ name: 'two.pdf',
103
+ content: File.open('spec/fixtures/universign-guide-8.8.pdf').read,
104
+ signature_fields: [
105
+ Universign::SignatureField.new(coordinate: [100, 120], page: 4, signer_index: 0),
106
+ ]
107
+ )
108
+
109
+ transaction = Universign::Transaction.create(
110
+ documents: [doc_1, doc_2],
111
+ signers: [signer],
112
+ options: { profile: 'default', final_doc_sent: true }
113
+ )
114
+ ```
115
+
116
+ - Multiple checkboxes
117
+ ```ruby
118
+ Universign::Document.new(
119
+ name: "one.pdf",
120
+ content: File.open("spec/fixtures/universign-guide-8.8.pdf").read,
121
+ check_box_texts: [
122
+ "My first checkbox text",
123
+ "My second checkbox text",
124
+ ""
125
+ ]
126
+ )
127
+ ```
128
+ Note that the last checkbox must be an empty string as requested in the official documentation.
114
129
 
115
130
  ### `Universign::Document`
116
131
 
@@ -88,6 +88,19 @@ module Universign
88
88
  end
89
89
  end
90
90
 
91
+ def check_box_texts
92
+ @check_box_texts ||= params["checkBoxTexts"]
93
+ end
94
+
95
+ def check_box_texts=(data)
96
+ if !data.is_a?(Array)
97
+ raise "CheckBoxTextsMustBeAnArray"
98
+ end
99
+
100
+ @check_box_texts = data
101
+ params["checkBoxTexts"] = data
102
+ end
103
+
91
104
  # The meta data of the PDF document
92
105
  #
93
106
  # @return [Hash]
@@ -1,3 +1,3 @@
1
1
  module Universign
2
- VERSION = "1.5.1"
2
+ VERSION = "1.6.0"
3
3
  end
metadata CHANGED
@@ -1,16 +1,16 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby_universign
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.1
4
+ version: 1.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nicolas Besnard
8
8
  - Yassine Zenati
9
9
  - Antoine Becquet
10
- autorequire:
10
+ autorequire:
11
11
  bindir: exe
12
12
  cert_chain: []
13
- date: 2021-03-09 00:00:00.000000000 Z
13
+ date: 2023-05-11 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: activesupport
@@ -167,7 +167,7 @@ homepage: https://github.com/CapSens/universign
167
167
  licenses:
168
168
  - MIT
169
169
  metadata: {}
170
- post_install_message:
170
+ post_install_message:
171
171
  rdoc_options: []
172
172
  require_paths:
173
173
  - lib
@@ -182,8 +182,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
182
182
  - !ruby/object:Gem::Version
183
183
  version: '0'
184
184
  requirements: []
185
- rubygems_version: 3.0.3
186
- signing_key:
185
+ rubygems_version: 3.3.7
186
+ signing_key:
187
187
  specification_version: 4
188
188
  summary: Universign's API Wrapper
189
189
  test_files: []