echosign 1.0.2 → 1.5.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.
Files changed (132) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +2 -1
  3. data/.rubocop.yml +14 -0
  4. data/.rubocop_todo.yml +241 -0
  5. data/.simplecov +2 -0
  6. data/.travis.yml +9 -0
  7. data/Gemfile +3 -3
  8. data/Gemfile.lock +74 -48
  9. data/README.md +43 -8
  10. data/Rakefile +2 -2
  11. data/doc/Echosign.html +135 -0
  12. data/doc/Echosign/Agreement.html +545 -0
  13. data/doc/Echosign/Client.html +5365 -0
  14. data/doc/Echosign/CounterSignerInfo.html +267 -0
  15. data/doc/Echosign/Credentials.html +1053 -0
  16. data/doc/Echosign/Fileinfo.html +305 -0
  17. data/doc/Echosign/FormFieldLocation.html +264 -0
  18. data/doc/Echosign/MegaSign.html +533 -0
  19. data/doc/Echosign/ParameterError.html +124 -0
  20. data/doc/Echosign/PhoneInfo.html +281 -0
  21. data/doc/Echosign/Recipient.html +311 -0
  22. data/doc/Echosign/RecipientSecurityOption.html +296 -0
  23. data/doc/Echosign/Refresh.html +288 -0
  24. data/doc/Echosign/Reminder.html +279 -0
  25. data/doc/Echosign/Request.html +5289 -0
  26. data/doc/Echosign/Request/EndpointHash.html +328 -0
  27. data/doc/Echosign/Request/Failure.html +290 -0
  28. data/doc/Echosign/RequestFormField.html +244 -0
  29. data/doc/Echosign/RequiredParameterError.html +124 -0
  30. data/doc/Echosign/UrlFileInfo.html +297 -0
  31. data/doc/Echosign/User.html +422 -0
  32. data/doc/Echosign/Validatable.html +355 -0
  33. data/doc/Echosign/Widget.html +924 -0
  34. data/doc/Echosign/WidgetCompletionInfo.html +323 -0
  35. data/doc/Echosign/WidgetPersonalization.html +330 -0
  36. data/doc/Echosign/WidgetSecurityOption.html +361 -0
  37. data/doc/Echosign/WidgetSignerSecurityOption.html +298 -0
  38. data/doc/Echosign/WidgetStatus.html +316 -0
  39. data/doc/Echosign/WidgetVaultingInfo.html +267 -0
  40. data/doc/_index.html +378 -0
  41. data/doc/class_list.html +51 -0
  42. data/doc/css/common.css +1 -0
  43. data/doc/css/full_list.css +58 -0
  44. data/doc/css/style.css +496 -0
  45. data/doc/file.README.html +191 -0
  46. data/doc/file_list.html +56 -0
  47. data/doc/frames.html +17 -0
  48. data/doc/index.html +191 -0
  49. data/doc/js/app.js +292 -0
  50. data/doc/js/full_list.js +216 -0
  51. data/doc/js/jquery.js +4 -0
  52. data/doc/method_list.html +1035 -0
  53. data/doc/top-level-namespace.html +110 -0
  54. data/echosign.gemspec +18 -20
  55. data/features/support/env.rb +8 -8
  56. data/fixtures/vcr_cassettes/agreement_combined_pdf.yml +2 -2
  57. data/fixtures/vcr_cassettes/agreement_document_file.yml +1 -1
  58. data/fixtures/vcr_cassettes/agreement_documents.yml +2 -2
  59. data/fixtures/vcr_cassettes/agreement_form_data.yml +1 -1
  60. data/fixtures/vcr_cassettes/agreement_info.yml +1 -1
  61. data/fixtures/vcr_cassettes/agreement_signing_urls.yml +1 -1
  62. data/fixtures/vcr_cassettes/audit_trail_pdf.yml +1 -1
  63. data/fixtures/vcr_cassettes/cancel_agreement.yml +1 -1
  64. data/fixtures/vcr_cassettes/create_agreement.yml +1 -1
  65. data/fixtures/vcr_cassettes/create_reminder.yml +1 -1
  66. data/fixtures/vcr_cassettes/create_transient_document.yml +1 -1
  67. data/fixtures/vcr_cassettes/create_user.yml +1 -1
  68. data/fixtures/vcr_cassettes/create_widget.yml +1 -1
  69. data/fixtures/vcr_cassettes/get_agreements.yml +1 -1
  70. data/fixtures/vcr_cassettes/get_library_document.yml +1 -1
  71. data/fixtures/vcr_cassettes/get_library_document_data.yml +1 -1
  72. data/fixtures/vcr_cassettes/get_library_document_file.yml +1 -1
  73. data/fixtures/vcr_cassettes/get_library_documents.yml +1 -1
  74. data/fixtures/vcr_cassettes/get_token.yml +22 -20
  75. data/fixtures/vcr_cassettes/get_user.yml +1 -1
  76. data/fixtures/vcr_cassettes/get_users.yml +2 -2
  77. data/fixtures/vcr_cassettes/get_widget.yml +1 -1
  78. data/fixtures/vcr_cassettes/get_widget_document_file.yml +1 -1
  79. data/fixtures/vcr_cassettes/get_widget_documents.yml +1 -1
  80. data/fixtures/vcr_cassettes/get_widgets.yml +1 -1
  81. data/fixtures/vcr_cassettes/library_combined_document.yml +2 -2
  82. data/fixtures/vcr_cassettes/library_document_audit_trail.yml +1 -1
  83. data/fixtures/vcr_cassettes/personalize_widget.yml +1 -1
  84. data/fixtures/vcr_cassettes/refresh_token.yml +46 -0
  85. data/fixtures/vcr_cassettes/revoke_token.yml +44 -0
  86. data/fixtures/vcr_cassettes/update_widget_status.yml +1 -1
  87. data/lib/echosign.rb +11 -11
  88. data/lib/echosign/agreement.rb +26 -10
  89. data/lib/echosign/agreement/client.rb +111 -104
  90. data/lib/echosign/agreement/fileinfo.rb +1 -3
  91. data/lib/echosign/agreement/form_field_location.rb +2 -3
  92. data/lib/echosign/agreement/phone_info.rb +5 -5
  93. data/lib/echosign/agreement/recipient.rb +9 -8
  94. data/lib/echosign/agreement/recipient_security_option.rb +5 -4
  95. data/lib/echosign/agreement/request.rb +33 -43
  96. data/lib/echosign/agreement/request_form_field.rb +2 -3
  97. data/lib/echosign/agreement/url_file_info.rb +8 -6
  98. data/lib/echosign/client.rb +33 -24
  99. data/lib/echosign/credentials.rb +95 -24
  100. data/lib/echosign/library_documents/client.rb +18 -23
  101. data/lib/echosign/library_documents/request.rb +19 -20
  102. data/lib/echosign/mega_sign.rb +20 -10
  103. data/lib/echosign/mega_sign/client.rb +109 -104
  104. data/lib/echosign/mega_sign/request.rb +32 -43
  105. data/lib/echosign/refresh.rb +6 -10
  106. data/lib/echosign/reminder.rb +2 -2
  107. data/lib/echosign/request.rb +85 -75
  108. data/lib/echosign/user.rb +13 -7
  109. data/lib/echosign/validatable.rb +6 -10
  110. data/lib/echosign/version.rb +1 -1
  111. data/lib/echosign/widget.rb +53 -27
  112. data/lib/echosign/widget/client.rb +33 -36
  113. data/lib/echosign/widget/counter_signer_info.rb +4 -5
  114. data/lib/echosign/widget/request.rb +28 -52
  115. data/lib/echosign/widget/widget_completion_info.rb +22 -12
  116. data/lib/echosign/widget/widget_personalization.rb +9 -7
  117. data/lib/echosign/widget/widget_security_option.rb +21 -11
  118. data/lib/echosign/widget/widget_signer_security_option.rb +8 -6
  119. data/lib/echosign/widget/widget_status.rb +10 -8
  120. data/lib/echosign/widget/widget_vaulting_info.rb +4 -5
  121. data/spec/lib/agreement/client_spec.rb +25 -31
  122. data/spec/lib/client_spec.rb +15 -18
  123. data/spec/lib/credentials_spec.rb +48 -0
  124. data/spec/lib/library_documents/client_spec.rb +11 -15
  125. data/spec/lib/shared_client.rb +9 -16
  126. data/spec/lib/user_spec.rb +0 -2
  127. data/spec/lib/validatable_spec.rb +12 -18
  128. data/spec/lib/version_spec.rb +1 -1
  129. data/spec/lib/widget/client_spec.rb +46 -49
  130. data/spec/spec_helper.rb +12 -5
  131. metadata +125 -60
  132. data/spec/lib/request_spec.rb +0 -18
@@ -0,0 +1,422 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>
7
+ Class: Echosign::User
8
+
9
+ &mdash; Documentation by YARD 0.9.16
10
+
11
+ </title>
12
+
13
+ <link rel="stylesheet" href="../css/style.css" type="text/css" charset="utf-8" />
14
+
15
+ <link rel="stylesheet" href="../css/common.css" type="text/css" charset="utf-8" />
16
+
17
+ <script type="text/javascript" charset="utf-8">
18
+ pathId = "Echosign::User";
19
+ relpath = '../';
20
+ </script>
21
+
22
+
23
+ <script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
24
+
25
+ <script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
26
+
27
+
28
+ </head>
29
+ <body>
30
+ <div class="nav_wrap">
31
+ <iframe id="nav" src="../class_list.html?1"></iframe>
32
+ <div id="resizer"></div>
33
+ </div>
34
+
35
+ <div id="main" tabindex="-1">
36
+ <div id="header">
37
+ <div id="menu">
38
+
39
+ <a href="../_index.html">Index (U)</a> &raquo;
40
+ <span class='title'><span class='object_link'><a href="../Echosign.html" title="Echosign (module)">Echosign</a></span></span>
41
+ &raquo;
42
+ <span class="title">User</span>
43
+
44
+ </div>
45
+
46
+ <div id="search">
47
+
48
+ <a class="full_list_link" id="class_list_link"
49
+ href="../class_list.html">
50
+
51
+ <svg width="24" height="24">
52
+ <rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
53
+ <rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
54
+ <rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
55
+ </svg>
56
+ </a>
57
+
58
+ </div>
59
+ <div class="clear"></div>
60
+ </div>
61
+
62
+ <div id="content"><h1>Class: Echosign::User
63
+
64
+
65
+
66
+ </h1>
67
+ <div class="box_info">
68
+
69
+ <dl>
70
+ <dt>Inherits:</dt>
71
+ <dd>
72
+ <span class="inheritName">Hash</span>
73
+
74
+ <ul class="fullTree">
75
+ <li>Object</li>
76
+
77
+ <li class="next">Hash</li>
78
+
79
+ <li class="next">Echosign::User</li>
80
+
81
+ </ul>
82
+ <a href="#" class="inheritanceTree">show all</a>
83
+
84
+ </dd>
85
+ </dl>
86
+
87
+
88
+
89
+
90
+
91
+
92
+ <dl>
93
+ <dt>Includes:</dt>
94
+ <dd><span class='object_link'><a href="Validatable.html" title="Echosign::Validatable (module)">Validatable</a></span></dd>
95
+ </dl>
96
+
97
+
98
+
99
+
100
+
101
+
102
+ <dl>
103
+ <dt>Defined in:</dt>
104
+ <dd>lib/echosign/user.rb</dd>
105
+ </dl>
106
+
107
+ </div>
108
+
109
+
110
+
111
+
112
+
113
+
114
+
115
+
116
+
117
+ <h2>
118
+ Instance Method Summary
119
+ <small><a href="#" class="summary_toggle">collapse</a></small>
120
+ </h2>
121
+
122
+ <ul class="summary">
123
+
124
+ <li class="public ">
125
+ <span class="summary_signature">
126
+
127
+ <a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong>(params) &#x21d2; String </a>
128
+
129
+
130
+
131
+ </span>
132
+
133
+
134
+ <span class="note title constructor">constructor</span>
135
+
136
+
137
+
138
+
139
+
140
+
141
+
142
+
143
+ <span class="summary_desc"><div class='inline'>
144
+ <p>Creates a user for the current application.</p>
145
+ </div></span>
146
+
147
+ </li>
148
+
149
+
150
+ </ul>
151
+
152
+
153
+
154
+
155
+
156
+
157
+
158
+
159
+
160
+
161
+
162
+ <h3 class="inherited">Methods included from <span class='object_link'><a href="Validatable.html" title="Echosign::Validatable (module)">Validatable</a></span></h3>
163
+ <p class="inherited"><span class='object_link'><a href="Validatable.html#require_exactly_one-instance_method" title="Echosign::Validatable#require_exactly_one (method)">#require_exactly_one</a></span>, <span class='object_link'><a href="Validatable.html#require_keys-instance_method" title="Echosign::Validatable#require_keys (method)">#require_keys</a></span>, <span class='object_link'><a href="Validatable.html#validate_field-instance_method" title="Echosign::Validatable#validate_field (method)">#validate_field</a></span></p>
164
+
165
+ <div id="constructor_details" class="method_details_list">
166
+ <h2>Constructor Details</h2>
167
+
168
+ <div class="method_details first">
169
+ <h3 class="signature first" id="initialize-instance_method">
170
+
171
+ #<strong>initialize</strong>(params) &#x21d2; <tt>String</tt>
172
+
173
+
174
+
175
+
176
+
177
+ </h3><div class="docstring">
178
+ <div class="discussion">
179
+
180
+ <p>Creates a user for the current application</p>
181
+
182
+
183
+ </div>
184
+ </div>
185
+ <div class="tags">
186
+ <p class="tag_title">Parameters:</p>
187
+ <ul class="param">
188
+
189
+ <li>
190
+
191
+ <span class='name'>params</span>
192
+
193
+
194
+ <span class='type'>(<tt>Hash</tt>)</span>
195
+
196
+
197
+
198
+ &mdash;
199
+ <div class='inline'>
200
+ <p>SYMBOL-referenced Hash containing:</p>
201
+ </div>
202
+
203
+ </li>
204
+
205
+ </ul>
206
+
207
+
208
+
209
+
210
+ <p class="tag_title">Options Hash (<tt>params</tt>):</p>
211
+ <ul class="option">
212
+
213
+ <li>
214
+ <span class="name">:email</span>
215
+ <span class="type">(<tt>String</tt>)</span>
216
+ <span class="default">
217
+
218
+ </span>
219
+
220
+ &mdash; <div class='inline'>
221
+ <p>User&#39;s email address (REQUIRED)</p>
222
+ </div>
223
+
224
+ </li>
225
+
226
+ <li>
227
+ <span class="name">:password</span>
228
+ <span class="type">(<tt>String</tt>)</span>
229
+ <span class="default">
230
+
231
+ </span>
232
+
233
+ &mdash; <div class='inline'>
234
+ <p>The new user&#39;s password (REQUIRED)</p>
235
+ </div>
236
+
237
+ </li>
238
+
239
+ <li>
240
+ <span class="name">:firstName</span>
241
+ <span class="type">(<tt>String</tt>)</span>
242
+ <span class="default">
243
+
244
+ </span>
245
+
246
+ &mdash; <div class='inline'>
247
+ <p>The first name of the new user (REQUIRED)</p>
248
+ </div>
249
+
250
+ </li>
251
+
252
+ <li>
253
+ <span class="name">:lastName</span>
254
+ <span class="type">(<tt>String</tt>)</span>
255
+ <span class="default">
256
+
257
+ </span>
258
+
259
+ &mdash; <div class='inline'>
260
+ <p>The last name of the new user (REQUIRED)</p>
261
+ </div>
262
+
263
+ </li>
264
+
265
+ <li>
266
+ <span class="name">:optIn</span>
267
+ <span class="type">(<tt>String</tt>)</span>
268
+ <span class="default">
269
+
270
+ </span>
271
+
272
+ &mdash; <div class='inline'>
273
+ <p>&#39;YES&#39; or &#39;NO&#39; or &#39;UNKNOWN&#39;: Whether or not the user
274
+ has opted in to recieve marketing information from EchoSign and its
275
+ partners. Default value is UNKNOWN</p>
276
+ </div>
277
+
278
+ </li>
279
+
280
+ <li>
281
+ <span class="name">:groupId</span>
282
+ <span class="type">(<tt>String</tt>)</span>
283
+ <span class="default">
284
+
285
+ </span>
286
+
287
+ &mdash; <div class='inline'>
288
+ <p>Group in which the new user should be added. It can be obtained through GET
289
+ /users call. Default is Group of the user making this call. The user is
290
+ inferred from the access_token header</p>
291
+ </div>
292
+
293
+ </li>
294
+
295
+ <li>
296
+ <span class="name">:title</span>
297
+ <span class="type">(<tt>String</tt>)</span>
298
+ <span class="default">
299
+
300
+ </span>
301
+
302
+ &mdash; <div class='inline'>
303
+ <p>The new user&#39;s job title</p>
304
+ </div>
305
+
306
+ </li>
307
+
308
+ <li>
309
+ <span class="name">:phone</span>
310
+ <span class="type">(<tt>String</tt>)</span>
311
+ <span class="default">
312
+
313
+ </span>
314
+
315
+ &mdash; <div class='inline'>
316
+ <p>The phone number of the new user</p>
317
+ </div>
318
+
319
+ </li>
320
+
321
+ <li>
322
+ <span class="name">:company</span>
323
+ <span class="type">(<tt>String</tt>)</span>
324
+ <span class="default">
325
+
326
+ </span>
327
+
328
+ &mdash; <div class='inline'>
329
+ <p>The name of the new user&#39;s company</p>
330
+ </div>
331
+
332
+ </li>
333
+
334
+ <li>
335
+ <span class="name">:customField1</span>
336
+ <span class="type">(<tt>String</tt>)</span>
337
+ <span class="default">
338
+
339
+ </span>
340
+
341
+ &mdash; <div class='inline'>
342
+ <p>You can choose to use custom fields to record additional information about
343
+ your new users. These fields are, however, available only with customized
344
+ implementations - please contact EchoSign if you would like to make use of
345
+ this functionality</p>
346
+ </div>
347
+
348
+ </li>
349
+
350
+ <li>
351
+ <span class="name">:customField2</span>
352
+ <span class="type">(<tt>String</tt>)</span>
353
+ <span class="default">
354
+
355
+ </span>
356
+
357
+ &mdash; <div class='inline'>
358
+ <p>You can choose to use custom fields to record additional information about
359
+ your new users. These fields are, however, available only with customized
360
+ implementations - please contact EchoSign if you would like to make use of
361
+ this functionality</p>
362
+ </div>
363
+
364
+ </li>
365
+
366
+ <li>
367
+ <span class="name">:customField3</span>
368
+ <span class="type">(<tt>String</tt>)</span>
369
+ <span class="default">
370
+
371
+ </span>
372
+
373
+ &mdash; <div class='inline'>
374
+ <p>You can choose to use custom fields to record additional information about
375
+ your new users. These fields are, however, available only with customized
376
+ implementations - please contact EchoSign if you would like to make use of
377
+ this functionality</p>
378
+ </div>
379
+
380
+ </li>
381
+
382
+ </ul>
383
+
384
+
385
+
386
+ </div><table class="source_code">
387
+ <tr>
388
+ <td>
389
+ <pre class="lines">
390
+
391
+
392
+ 30
393
+ 31
394
+ 32
395
+ 33</pre>
396
+ </td>
397
+ <td>
398
+ <pre class="code"><span class="info file"># File 'lib/echosign/user.rb', line 30</span>
399
+
400
+ <span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_params'>params</span><span class='rparen'>)</span>
401
+ <span class='id identifier rubyid_require_keys'>require_keys</span><span class='lparen'>(</span><span class='lbracket'>[</span><span class='symbol'>:firstName</span><span class='comma'>,</span> <span class='symbol'>:lastName</span><span class='comma'>,</span> <span class='symbol'>:email</span><span class='comma'>,</span> <span class='symbol'>:password</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='id identifier rubyid_params'>params</span><span class='rparen'>)</span>
402
+ <span class='id identifier rubyid_merge!'>merge!</span><span class='lparen'>(</span><span class='id identifier rubyid_params'>params</span><span class='rparen'>)</span>
403
+ <span class='kw'>end</span></pre>
404
+ </td>
405
+ </tr>
406
+ </table>
407
+ </div>
408
+
409
+ </div>
410
+
411
+
412
+ </div>
413
+
414
+ <div id="footer">
415
+ Generated on Thu Oct 18 12:44:46 2018 by
416
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
417
+ 0.9.16 (ruby-2.6.0).
418
+ </div>
419
+
420
+ </div>
421
+ </body>
422
+ </html>
@@ -0,0 +1,355 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>
7
+ Module: Echosign::Validatable
8
+
9
+ &mdash; Documentation by YARD 0.9.16
10
+
11
+ </title>
12
+
13
+ <link rel="stylesheet" href="../css/style.css" type="text/css" charset="utf-8" />
14
+
15
+ <link rel="stylesheet" href="../css/common.css" type="text/css" charset="utf-8" />
16
+
17
+ <script type="text/javascript" charset="utf-8">
18
+ pathId = "Echosign::Validatable";
19
+ relpath = '../';
20
+ </script>
21
+
22
+
23
+ <script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
24
+
25
+ <script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
26
+
27
+
28
+ </head>
29
+ <body>
30
+ <div class="nav_wrap">
31
+ <iframe id="nav" src="../class_list.html?1"></iframe>
32
+ <div id="resizer"></div>
33
+ </div>
34
+
35
+ <div id="main" tabindex="-1">
36
+ <div id="header">
37
+ <div id="menu">
38
+
39
+ <a href="../_index.html">Index (V)</a> &raquo;
40
+ <span class='title'><span class='object_link'><a href="../Echosign.html" title="Echosign (module)">Echosign</a></span></span>
41
+ &raquo;
42
+ <span class="title">Validatable</span>
43
+
44
+ </div>
45
+
46
+ <div id="search">
47
+
48
+ <a class="full_list_link" id="class_list_link"
49
+ href="../class_list.html">
50
+
51
+ <svg width="24" height="24">
52
+ <rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
53
+ <rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
54
+ <rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
55
+ </svg>
56
+ </a>
57
+
58
+ </div>
59
+ <div class="clear"></div>
60
+ </div>
61
+
62
+ <div id="content"><h1>Module: Echosign::Validatable
63
+
64
+
65
+
66
+ </h1>
67
+ <div class="box_info">
68
+
69
+
70
+
71
+
72
+
73
+
74
+
75
+
76
+
77
+ <dl>
78
+ <dt>Included in:</dt>
79
+ <dd><span class='object_link'><a href="Agreement.html" title="Echosign::Agreement (class)">Agreement</a></span>, <span class='object_link'><a href="CounterSignerInfo.html" title="Echosign::CounterSignerInfo (class)">CounterSignerInfo</a></span>, <span class='object_link'><a href="Credentials.html" title="Echosign::Credentials (class)">Credentials</a></span>, <span class='object_link'><a href="Fileinfo.html" title="Echosign::Fileinfo (class)">Fileinfo</a></span>, <span class='object_link'><a href="FormFieldLocation.html" title="Echosign::FormFieldLocation (class)">FormFieldLocation</a></span>, <span class='object_link'><a href="MegaSign.html" title="Echosign::MegaSign (class)">MegaSign</a></span>, <span class='object_link'><a href="PhoneInfo.html" title="Echosign::PhoneInfo (class)">PhoneInfo</a></span>, <span class='object_link'><a href="Recipient.html" title="Echosign::Recipient (class)">Recipient</a></span>, <span class='object_link'><a href="RecipientSecurityOption.html" title="Echosign::RecipientSecurityOption (class)">RecipientSecurityOption</a></span>, <span class='object_link'><a href="Refresh.html" title="Echosign::Refresh (class)">Refresh</a></span>, <span class='object_link'><a href="Reminder.html" title="Echosign::Reminder (class)">Reminder</a></span>, <span class='object_link'><a href="RequestFormField.html" title="Echosign::RequestFormField (class)">RequestFormField</a></span>, <span class='object_link'><a href="UrlFileInfo.html" title="Echosign::UrlFileInfo (class)">UrlFileInfo</a></span>, <span class='object_link'><a href="User.html" title="Echosign::User (class)">User</a></span>, <span class='object_link'><a href="Widget.html" title="Echosign::Widget (class)">Widget</a></span>, <span class='object_link'><a href="WidgetCompletionInfo.html" title="Echosign::WidgetCompletionInfo (class)">WidgetCompletionInfo</a></span>, <span class='object_link'><a href="WidgetPersonalization.html" title="Echosign::WidgetPersonalization (class)">WidgetPersonalization</a></span>, <span class='object_link'><a href="WidgetSecurityOption.html" title="Echosign::WidgetSecurityOption (class)">WidgetSecurityOption</a></span>, <span class='object_link'><a href="WidgetSignerSecurityOption.html" title="Echosign::WidgetSignerSecurityOption (class)">WidgetSignerSecurityOption</a></span>, <span class='object_link'><a href="WidgetStatus.html" title="Echosign::WidgetStatus (class)">WidgetStatus</a></span>, <span class='object_link'><a href="WidgetVaultingInfo.html" title="Echosign::WidgetVaultingInfo (class)">WidgetVaultingInfo</a></span></dd>
80
+ </dl>
81
+
82
+
83
+
84
+ <dl>
85
+ <dt>Defined in:</dt>
86
+ <dd>lib/echosign/validatable.rb</dd>
87
+ </dl>
88
+
89
+ </div>
90
+
91
+
92
+
93
+
94
+
95
+
96
+
97
+
98
+
99
+ <h2>
100
+ Instance Method Summary
101
+ <small><a href="#" class="summary_toggle">collapse</a></small>
102
+ </h2>
103
+
104
+ <ul class="summary">
105
+
106
+ <li class="public ">
107
+ <span class="summary_signature">
108
+
109
+ <a href="#require_exactly_one-instance_method" title="#require_exactly_one (instance method)">#<strong>require_exactly_one</strong>(field_group, params) &#x21d2; Object </a>
110
+
111
+
112
+
113
+ </span>
114
+
115
+
116
+
117
+
118
+
119
+
120
+
121
+
122
+
123
+ <span class="summary_desc"><div class='inline'></div></span>
124
+
125
+ </li>
126
+
127
+
128
+ <li class="public ">
129
+ <span class="summary_signature">
130
+
131
+ <a href="#require_keys-instance_method" title="#require_keys (instance method)">#<strong>require_keys</strong>(required_fields, params) &#x21d2; Object </a>
132
+
133
+
134
+
135
+ </span>
136
+
137
+
138
+
139
+
140
+
141
+
142
+
143
+
144
+
145
+ <span class="summary_desc"><div class='inline'></div></span>
146
+
147
+ </li>
148
+
149
+
150
+ <li class="public ">
151
+ <span class="summary_signature">
152
+
153
+ <a href="#validate_field-instance_method" title="#validate_field (instance method)">#<strong>validate_field</strong>(field, params) &#x21d2; Object </a>
154
+
155
+
156
+
157
+ </span>
158
+
159
+
160
+
161
+
162
+
163
+
164
+
165
+
166
+
167
+ <span class="summary_desc"><div class='inline'>
168
+ <p>TODO (bernardworthy) A validator accepting a block for conditional
169
+ execution might be useful.</p>
170
+ </div></span>
171
+
172
+ </li>
173
+
174
+
175
+ </ul>
176
+
177
+
178
+
179
+
180
+ <div id="instance_method_details" class="method_details_list">
181
+ <h2>Instance Method Details</h2>
182
+
183
+
184
+ <div class="method_details first">
185
+ <h3 class="signature first" id="require_exactly_one-instance_method">
186
+
187
+ #<strong>require_exactly_one</strong>(field_group, params) &#x21d2; <tt>Object</tt>
188
+
189
+
190
+
191
+
192
+
193
+ </h3><div class="docstring">
194
+ <div class="discussion">
195
+
196
+
197
+ </div>
198
+ </div>
199
+ <div class="tags">
200
+
201
+ <p class="tag_title">Raises:</p>
202
+ <ul class="raise">
203
+
204
+ <li>
205
+
206
+
207
+ <span class='type'>(<tt><span class='object_link'><a href="ParameterError.html" title="Echosign::ParameterError (class)">ParameterError</a></span></tt>)</span>
208
+
209
+
210
+
211
+ </li>
212
+
213
+ </ul>
214
+
215
+ </div><table class="source_code">
216
+ <tr>
217
+ <td>
218
+ <pre class="lines">
219
+
220
+
221
+ 12
222
+ 13
223
+ 14
224
+ 15
225
+ 16
226
+ 17
227
+ 18
228
+ 19
229
+ 20
230
+ 21
231
+ 22
232
+ 23
233
+ 24</pre>
234
+ </td>
235
+ <td>
236
+ <pre class="code"><span class="info file"># File 'lib/echosign/validatable.rb', line 12</span>
237
+
238
+ <span class='kw'>def</span> <span class='id identifier rubyid_require_exactly_one'>require_exactly_one</span><span class='lparen'>(</span><span class='id identifier rubyid_field_group'>field_group</span><span class='comma'>,</span> <span class='id identifier rubyid_params'>params</span><span class='rparen'>)</span>
239
+ <span class='id identifier rubyid_set_fields'>set_fields</span> <span class='op'>=</span> <span class='int'>0</span>
240
+ <span class='id identifier rubyid_field_group'>field_group</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_field'>field</span><span class='op'>|</span>
241
+ <span class='kw'>begin</span>
242
+ <span class='id identifier rubyid_validate_field'>validate_field</span><span class='lparen'>(</span><span class='id identifier rubyid_field'>field</span><span class='comma'>,</span> <span class='id identifier rubyid_params'>params</span><span class='rparen'>)</span>
243
+ <span class='kw'>rescue</span> <span class='const'><span class='object_link'><a href="RequiredParameterError.html" title="Echosign::RequiredParameterError (class)">RequiredParameterError</a></span></span>
244
+ <span class='kw'>next</span>
245
+ <span class='kw'>else</span>
246
+ <span class='id identifier rubyid_set_fields'>set_fields</span> <span class='op'>+=</span> <span class='int'>1</span>
247
+ <span class='kw'>end</span>
248
+ <span class='kw'>end</span>
249
+ <span class='id identifier rubyid_raise'>raise</span> <span class='const'><span class='object_link'><a href="ParameterError.html" title="Echosign::ParameterError (class)">ParameterError</a></span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Exactly one of </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_field_group'>field_group</span><span class='embexpr_end'>}</span><span class='tstring_content'> should be present</span><span class='tstring_end'>&quot;</span></span> <span class='kw'>if</span> <span class='id identifier rubyid_set_fields'>set_fields</span> <span class='op'>!=</span> <span class='int'>1</span>
250
+ <span class='kw'>end</span></pre>
251
+ </td>
252
+ </tr>
253
+ </table>
254
+ </div>
255
+
256
+ <div class="method_details ">
257
+ <h3 class="signature " id="require_keys-instance_method">
258
+
259
+ #<strong>require_keys</strong>(required_fields, params) &#x21d2; <tt>Object</tt>
260
+
261
+
262
+
263
+
264
+
265
+ </h3><table class="source_code">
266
+ <tr>
267
+ <td>
268
+ <pre class="lines">
269
+
270
+
271
+ 6
272
+ 7
273
+ 8
274
+ 9
275
+ 10</pre>
276
+ </td>
277
+ <td>
278
+ <pre class="code"><span class="info file"># File 'lib/echosign/validatable.rb', line 6</span>
279
+
280
+ <span class='kw'>def</span> <span class='id identifier rubyid_require_keys'>require_keys</span><span class='lparen'>(</span><span class='id identifier rubyid_required_fields'>required_fields</span><span class='comma'>,</span> <span class='id identifier rubyid_params'>params</span><span class='rparen'>)</span>
281
+ <span class='id identifier rubyid_required_fields'>required_fields</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_field'>field</span><span class='op'>|</span>
282
+ <span class='id identifier rubyid_validate_field'>validate_field</span><span class='lparen'>(</span><span class='id identifier rubyid_field'>field</span><span class='comma'>,</span> <span class='id identifier rubyid_params'>params</span><span class='rparen'>)</span>
283
+ <span class='kw'>end</span>
284
+ <span class='kw'>end</span></pre>
285
+ </td>
286
+ </tr>
287
+ </table>
288
+ </div>
289
+
290
+ <div class="method_details ">
291
+ <h3 class="signature " id="validate_field-instance_method">
292
+
293
+ #<strong>validate_field</strong>(field, params) &#x21d2; <tt>Object</tt>
294
+
295
+
296
+
297
+
298
+
299
+ </h3><div class="docstring">
300
+ <div class="discussion">
301
+
302
+ <p>TODO (bernardworthy) A validator accepting a block for conditional
303
+ execution might be useful. Maybe require_keys should accept a block.
304
+ Figure out later.</p>
305
+
306
+
307
+ </div>
308
+ </div>
309
+ <div class="tags">
310
+
311
+
312
+ </div><table class="source_code">
313
+ <tr>
314
+ <td>
315
+ <pre class="lines">
316
+
317
+
318
+ 30
319
+ 31
320
+ 32
321
+ 33
322
+ 34
323
+ 35
324
+ 36
325
+ 37</pre>
326
+ </td>
327
+ <td>
328
+ <pre class="code"><span class="info file"># File 'lib/echosign/validatable.rb', line 30</span>
329
+
330
+ <span class='kw'>def</span> <span class='id identifier rubyid_validate_field'>validate_field</span><span class='lparen'>(</span><span class='id identifier rubyid_field'>field</span><span class='comma'>,</span> <span class='id identifier rubyid_params'>params</span><span class='rparen'>)</span>
331
+ <span class='kw'>begin</span>
332
+ <span class='id identifier rubyid_value'>value</span> <span class='op'>=</span> <span class='id identifier rubyid_params'>params</span><span class='period'>.</span><span class='id identifier rubyid_fetch'>fetch</span><span class='lparen'>(</span><span class='id identifier rubyid_field'>field</span><span class='rparen'>)</span>
333
+ <span class='id identifier rubyid_required_error'>required_error</span><span class='lparen'>(</span><span class='id identifier rubyid_field'>field</span><span class='rparen'>)</span> <span class='kw'>if</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span> <span class='op'>||</span> <span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>String</span><span class='rparen'>)</span> <span class='op'>&amp;&amp;</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_empty?'>empty?</span><span class='rparen'>)</span>
334
+ <span class='kw'>rescue</span> <span class='const'>KeyError</span>
335
+ <span class='id identifier rubyid_required_error'>required_error</span><span class='lparen'>(</span><span class='id identifier rubyid_field'>field</span><span class='rparen'>)</span>
336
+ <span class='kw'>end</span>
337
+ <span class='kw'>end</span></pre>
338
+ </td>
339
+ </tr>
340
+ </table>
341
+ </div>
342
+
343
+ </div>
344
+
345
+ </div>
346
+
347
+ <div id="footer">
348
+ Generated on Thu Oct 18 12:44:46 2018 by
349
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
350
+ 0.9.16 (ruby-2.6.0).
351
+ </div>
352
+
353
+ </div>
354
+ </body>
355
+ </html>