echochamber 1.0.1

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