apes 1.0.1 → 1.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (107) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +1 -1
  3. data/.travis-gemfile +1 -1
  4. data/.travis.yml +1 -4
  5. data/.yardopts +1 -1
  6. data/CHANGELOG.md +8 -0
  7. data/Gemfile +1 -1
  8. data/LICENSE.md +21 -0
  9. data/README.md +22 -16
  10. data/Rakefile +1 -1
  11. data/apes.gemspec +1 -1
  12. data/{doc → docs}/Apes.html +1 -1
  13. data/{doc → docs}/Apes/Concerns.html +1 -1
  14. data/{doc → docs}/Apes/Concerns/Errors.html +1 -1
  15. data/{doc → docs}/Apes/Concerns/Pagination.html +1 -1
  16. data/{doc → docs}/Apes/Concerns/Request.html +1 -1
  17. data/{doc → docs}/Apes/Concerns/Response.html +1 -1
  18. data/{doc → docs}/Apes/Controller.html +1 -1
  19. data/{doc → docs}/Apes/Errors.html +1 -1
  20. data/{doc → docs}/Apes/Errors/AuthenticationError.html +1 -1
  21. data/{doc → docs}/Apes/Errors/BadRequestError.html +1 -1
  22. data/{doc → docs}/Apes/Errors/BaseError.html +1 -1
  23. data/{doc → docs}/Apes/Errors/InvalidDataError.html +1 -1
  24. data/{doc → docs}/Apes/Errors/MissingDataError.html +1 -1
  25. data/{doc → docs}/Apes/Model.html +1 -1
  26. data/{doc → docs}/Apes/PaginationCursor.html +1 -1
  27. data/{doc → docs}/Apes/RuntimeConfiguration.html +1 -1
  28. data/{doc → docs}/Apes/Serializers.html +1 -1
  29. data/{doc → docs}/Apes/Serializers/JSON.html +1 -1
  30. data/{doc → docs}/Apes/Serializers/JWT.html +1 -1
  31. data/{doc → docs}/Apes/Serializers/List.html +1 -1
  32. data/{doc → docs}/Apes/UrlsParser.html +1 -1
  33. data/{doc → docs}/Apes/Validators.html +1 -1
  34. data/{doc → docs}/Apes/Validators/BaseValidator.html +1 -1
  35. data/{doc → docs}/Apes/Validators/BooleanValidator.html +1 -1
  36. data/{doc → docs}/Apes/Validators/EmailValidator.html +1 -1
  37. data/{doc → docs}/Apes/Validators/PhoneValidator.html +1 -1
  38. data/{doc → docs}/Apes/Validators/ReferenceValidator.html +1 -1
  39. data/{doc → docs}/Apes/Validators/TimestampValidator.html +1 -1
  40. data/{doc → docs}/Apes/Validators/UuidValidator.html +1 -1
  41. data/{doc → docs}/Apes/Validators/ZipCodeValidator.html +1 -1
  42. data/{doc → docs}/Apes/Version.html +1 -1
  43. data/{doc → docs}/_index.html +1 -1
  44. data/{doc → docs}/class_list.html +0 -0
  45. data/{doc → docs}/css/common.css +0 -0
  46. data/{doc → docs}/css/full_list.css +0 -0
  47. data/{doc → docs}/css/style.css +0 -0
  48. data/{doc → docs}/file.README.html +7 -5
  49. data/{doc → docs}/file_list.html +0 -0
  50. data/{doc → docs}/frames.html +0 -0
  51. data/{doc → docs}/index.html +7 -5
  52. data/{doc → docs}/js/app.js +0 -0
  53. data/{doc → docs}/js/full_list.js +0 -0
  54. data/{doc → docs}/js/jquery.js +0 -0
  55. data/{doc → docs}/method_list.html +0 -0
  56. data/{doc → docs}/top-level-namespace.html +1 -1
  57. data/lib/apes.rb +1 -1
  58. data/lib/apes/concerns/errors.rb +1 -1
  59. data/lib/apes/concerns/pagination.rb +1 -1
  60. data/lib/apes/concerns/request.rb +1 -1
  61. data/lib/apes/concerns/response.rb +1 -1
  62. data/lib/apes/controller.rb +1 -1
  63. data/lib/apes/errors.rb +1 -1
  64. data/lib/apes/model.rb +1 -1
  65. data/lib/apes/pagination_cursor.rb +1 -1
  66. data/lib/apes/runtime_configuration.rb +1 -1
  67. data/lib/apes/serializers.rb +1 -1
  68. data/lib/apes/urls_parser.rb +1 -1
  69. data/lib/apes/validators.rb +1 -1
  70. data/lib/apes/version.rb +2 -2
  71. data/spec/apes/controller_spec.rb +1 -1
  72. data/spec/apes/errors_spec.rb +1 -1
  73. data/spec/apes/models_spec.rb +1 -1
  74. data/spec/apes/pagination_cursor_spec.rb +1 -1
  75. data/spec/apes/runtime_configuration_spec.rb +1 -1
  76. data/spec/apes/serializers_spec.rb +1 -1
  77. data/spec/apes/urls_parser_spec.rb +1 -1
  78. data/spec/apes/validators_spec.rb +1 -1
  79. data/spec/spec_helper.rb +1 -1
  80. metadata +49 -75
  81. data/doc/ApplicationController.html +0 -547
  82. data/doc/Concerns.html +0 -128
  83. data/doc/Concerns/ErrorHandling.html +0 -826
  84. data/doc/Concerns/PaginationHandling.html +0 -463
  85. data/doc/Concerns/RequestHandling.html +0 -512
  86. data/doc/Concerns/ResponseHandling.html +0 -579
  87. data/doc/Errors.html +0 -126
  88. data/doc/Errors/AuthenticationError.html +0 -123
  89. data/doc/Errors/BadRequestError.html +0 -147
  90. data/doc/Errors/BaseError.html +0 -289
  91. data/doc/Errors/InvalidDataError.html +0 -147
  92. data/doc/Errors/MissingDataError.html +0 -147
  93. data/doc/Model.html +0 -315
  94. data/doc/PaginationCursor.html +0 -764
  95. data/doc/Serializers.html +0 -126
  96. data/doc/Serializers/JSON.html +0 -253
  97. data/doc/Serializers/JWT.html +0 -253
  98. data/doc/Serializers/List.html +0 -245
  99. data/doc/Validators.html +0 -126
  100. data/doc/Validators/BaseValidator.html +0 -209
  101. data/doc/Validators/BooleanValidator.html +0 -391
  102. data/doc/Validators/EmailValidator.html +0 -298
  103. data/doc/Validators/PhoneValidator.html +0 -313
  104. data/doc/Validators/ReferenceValidator.html +0 -284
  105. data/doc/Validators/TimestampValidator.html +0 -476
  106. data/doc/Validators/UuidValidator.html +0 -310
  107. data/doc/Validators/ZipCodeValidator.html +0 -310
@@ -1,476 +0,0 @@
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: Validators::TimestampValidator
8
-
9
- &mdash; Documentation by YARD 0.8.7.6
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#!Validators/TimestampValidator.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 (T)</a> &raquo;
35
- <span class='title'><span class='object_link'><a href="../Validators.html" title="Validators (module)">Validators</a></span></span>
36
- &raquo;
37
- <span class="title">TimestampValidator</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: Validators::TimestampValidator
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"><span class='object_link'><a href="BaseValidator.html" title="Validators::BaseValidator (class)">BaseValidator</a></span></span>
77
-
78
- <ul class="fullTree">
79
- <li>Object</li>
80
-
81
- <li class="next">ActiveModel::EachValidator</li>
82
-
83
- <li class="next"><span class='object_link'><a href="BaseValidator.html" title="Validators::BaseValidator (class)">BaseValidator</a></span></li>
84
-
85
- <li class="next">Validators::TimestampValidator</li>
86
-
87
- </ul>
88
- <a href="#" class="inheritanceTree">show all</a>
89
-
90
- </dd>
91
-
92
-
93
-
94
-
95
-
96
-
97
-
98
-
99
-
100
- <dt class="r2 last">Defined in:</dt>
101
- <dd class="r2 last">lib/apes/validators.rb</dd>
102
-
103
- </dl>
104
- <div class="clear"></div>
105
-
106
-
107
-
108
-
109
-
110
-
111
-
112
-
113
-
114
- <h2>
115
- Class Method Summary
116
- <small>(<a href="#" class="summary_toggle">collapse</a>)</small>
117
- </h2>
118
-
119
- <ul class="summary">
120
-
121
- <li class="public ">
122
- <span class="summary_signature">
123
-
124
- <a href="#parse-class_method" title="parse (class method)">+ (Object) <strong>parse</strong>(value, formats: nil, raise_errors: false) </a>
125
-
126
-
127
-
128
- </span>
129
-
130
-
131
-
132
-
133
-
134
-
135
-
136
-
137
-
138
- <span class="summary_desc"><div class='inline'>
139
- </div></span>
140
-
141
- </li>
142
-
143
-
144
- <li class="public ">
145
- <span class="summary_signature">
146
-
147
- <a href="#safe_parse-class_method" title="safe_parse (class method)">+ (Object) <strong>safe_parse</strong>(value, format) </a>
148
-
149
-
150
-
151
- </span>
152
-
153
-
154
-
155
-
156
-
157
-
158
-
159
-
160
-
161
- <span class="summary_desc"><div class='inline'>
162
- </div></span>
163
-
164
- </li>
165
-
166
-
167
- </ul>
168
-
169
- <h2>
170
- Instance Method Summary
171
- <small>(<a href="#" class="summary_toggle">collapse</a>)</small>
172
- </h2>
173
-
174
- <ul class="summary">
175
-
176
- <li class="public ">
177
- <span class="summary_signature">
178
-
179
- <a href="#check_valid%3F-instance_method" title="#check_valid? (instance method)">- (Boolean) <strong>check_valid?</strong>(value) </a>
180
-
181
-
182
-
183
- </span>
184
-
185
-
186
-
187
-
188
-
189
-
190
-
191
-
192
-
193
- <span class="summary_desc"><div class='inline'>
194
- </div></span>
195
-
196
- </li>
197
-
198
-
199
- <li class="public ">
200
- <span class="summary_signature">
201
-
202
- <a href="#initialize-instance_method" title="#initialize (instance method)">- (TimestampValidator) <strong>initialize</strong>(options) </a>
203
-
204
-
205
-
206
- </span>
207
-
208
-
209
- <span class="note title constructor">constructor</span>
210
-
211
-
212
-
213
-
214
-
215
-
216
-
217
-
218
- <span class="summary_desc"><div class='inline'><p>A new instance of TimestampValidator.</p>
219
- </div></span>
220
-
221
- </li>
222
-
223
-
224
- </ul>
225
-
226
-
227
-
228
-
229
-
230
-
231
-
232
-
233
-
234
-
235
-
236
- <h3 class="inherited">Methods inherited from <span class='object_link'><a href="BaseValidator.html" title="Validators::BaseValidator (class)">BaseValidator</a></span></h3>
237
- <p class="inherited"><span class='object_link'><a href="BaseValidator.html#validate_each-instance_method" title="Validators::BaseValidator#validate_each (method)">#validate_each</a></span></p>
238
-
239
- <div id="constructor_details" class="method_details_list">
240
- <h2>Constructor Details</h2>
241
-
242
- <div class="method_details first">
243
- <h3 class="signature first" id="initialize-instance_method">
244
-
245
- - (<tt><span class='object_link'><a href="" title="Validators::TimestampValidator (class)">TimestampValidator</a></span></tt>) <strong>initialize</strong>(options)
246
-
247
-
248
-
249
-
250
-
251
- </h3><div class="docstring">
252
- <div class="discussion">
253
- <p>Returns a new instance of TimestampValidator</p>
254
-
255
-
256
- </div>
257
- </div>
258
- <div class="tags">
259
-
260
-
261
- </div><table class="source_code">
262
- <tr>
263
- <td>
264
- <pre class="lines">
265
-
266
-
267
- 134
268
- 135
269
- 136</pre>
270
- </td>
271
- <td>
272
- <pre class="code"><span class="info file"># File 'lib/apes/validators.rb', line 134</span>
273
-
274
- <span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_options'>options</span><span class='rparen'>)</span>
275
- <span class='kw'>super</span><span class='lparen'>(</span><span class='id identifier rubyid_options'>options</span><span class='period'>.</span><span class='id identifier rubyid_reverse_merge'>reverse_merge</span><span class='lparen'>(</span><span class='label'>default_message:</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>must be a valid ISO 8601 timestamp</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span><span class='rparen'>)</span>
276
- <span class='kw'>end</span></pre>
277
- </td>
278
- </tr>
279
- </table>
280
- </div>
281
-
282
- </div>
283
-
284
-
285
- <div id="class_method_details" class="method_details_list">
286
- <h2>Class Method Details</h2>
287
-
288
-
289
- <div class="method_details first">
290
- <h3 class="signature first" id="parse-class_method">
291
-
292
- + (<tt>Object</tt>) <strong>parse</strong>(value, formats: nil, raise_errors: false)
293
-
294
-
295
-
296
-
297
-
298
- </h3><div class="docstring">
299
- <div class="discussion">
300
-
301
-
302
-
303
- </div>
304
- </div>
305
- <div class="tags">
306
-
307
- <p class="tag_title">Raises:</p>
308
- <ul class="raise">
309
-
310
- <li>
311
-
312
-
313
- <span class='type'>(<tt>ArgumentError</tt>)</span>
314
-
315
-
316
-
317
- </li>
318
-
319
- </ul>
320
-
321
- </div><table class="source_code">
322
- <tr>
323
- <td>
324
- <pre class="lines">
325
-
326
-
327
- 109
328
- 110
329
- 111
330
- 112
331
- 113
332
- 114
333
- 115
334
- 116
335
- 117
336
- 118
337
- 119
338
- 120
339
- 121
340
- 122
341
- 123
342
- 124
343
- 125
344
- 126</pre>
345
- </td>
346
- <td>
347
- <pre class="code"><span class="info file"># File 'lib/apes/validators.rb', line 109</span>
348
-
349
- <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_parse'>parse</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='comma'>,</span> <span class='label'>formats:</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='label'>raise_errors:</span> <span class='kw'>false</span><span class='rparen'>)</span>
350
- <span class='kw'>return</span> <span class='id identifier rubyid_value'>value</span> <span class='kw'>if</span> <span class='lbracket'>[</span><span class='const'>ActiveSupport</span><span class='op'>::</span><span class='const'>TimeWithZone</span><span class='comma'>,</span> <span class='const'>DateTime</span><span class='comma'>,</span> <span class='const'>Date</span><span class='comma'>,</span> <span class='const'>Time</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_include?'>include?</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span><span class='rparen'>)</span>
351
-
352
- <span class='id identifier rubyid_formats'>formats</span> <span class='op'>||=</span> <span class='const'>Rails</span><span class='period'>.</span><span class='id identifier rubyid_application'>application</span><span class='period'>.</span><span class='id identifier rubyid_config'>config</span><span class='period'>.</span><span class='id identifier rubyid_timestamp_formats'>timestamp_formats</span><span class='period'>.</span><span class='id identifier rubyid_values'>values</span><span class='period'>.</span><span class='id identifier rubyid_dup'>dup</span>
353
-
354
- <span class='id identifier rubyid_rv'>rv</span> <span class='op'>=</span> <span class='id identifier rubyid_catch'>catch</span><span class='lparen'>(</span><span class='symbol'>:valid</span><span class='rparen'>)</span> <span class='kw'>do</span>
355
- <span class='id identifier rubyid_formats'>formats</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_format'>format</span><span class='op'>|</span>
356
- <span class='id identifier rubyid_parsed'>parsed</span> <span class='op'>=</span> <span class='id identifier rubyid_safe_parse'>safe_parse</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='comma'>,</span> <span class='id identifier rubyid_format'>format</span><span class='rparen'>)</span>
357
-
358
- <span class='id identifier rubyid_throw'>throw</span><span class='lparen'>(</span><span class='symbol'>:valid</span><span class='comma'>,</span> <span class='id identifier rubyid_parsed'>parsed</span><span class='rparen'>)</span> <span class='kw'>if</span> <span class='id identifier rubyid_parsed'>parsed</span>
359
- <span class='kw'>end</span>
360
-
361
- <span class='kw'>nil</span>
362
- <span class='kw'>end</span>
363
-
364
- <span class='id identifier rubyid_raise'>raise</span><span class='lparen'>(</span><span class='const'>ArgumentError</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Invalid timestamp \&quot;</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_value'>value</span><span class='embexpr_end'>}</span><span class='tstring_content'>\&quot;.</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span> <span class='kw'>if</span> <span class='op'>!</span><span class='id identifier rubyid_rv'>rv</span> <span class='op'>&amp;&amp;</span> <span class='id identifier rubyid_raise_errors'>raise_errors</span>
365
- <span class='id identifier rubyid_rv'>rv</span>
366
- <span class='kw'>end</span></pre>
367
- </td>
368
- </tr>
369
- </table>
370
- </div>
371
-
372
- <div class="method_details ">
373
- <h3 class="signature " id="safe_parse-class_method">
374
-
375
- + (<tt>Object</tt>) <strong>safe_parse</strong>(value, format)
376
-
377
-
378
-
379
-
380
-
381
- </h3><table class="source_code">
382
- <tr>
383
- <td>
384
- <pre class="lines">
385
-
386
-
387
- 128
388
- 129
389
- 130
390
- 131
391
- 132</pre>
392
- </td>
393
- <td>
394
- <pre class="code"><span class="info file"># File 'lib/apes/validators.rb', line 128</span>
395
-
396
- <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_safe_parse'>safe_parse</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='comma'>,</span> <span class='id identifier rubyid_format'>format</span><span class='rparen'>)</span>
397
- <span class='const'>DateTime</span><span class='period'>.</span><span class='id identifier rubyid_strptime'>strptime</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='comma'>,</span> <span class='id identifier rubyid_format'>format</span><span class='rparen'>)</span>
398
- <span class='kw'>rescue</span>
399
- <span class='kw'>nil</span>
400
- <span class='kw'>end</span></pre>
401
- </td>
402
- </tr>
403
- </table>
404
- </div>
405
-
406
- </div>
407
-
408
- <div id="instance_method_details" class="method_details_list">
409
- <h2>Instance Method Details</h2>
410
-
411
-
412
- <div class="method_details first">
413
- <h3 class="signature first" id="check_valid?-instance_method">
414
-
415
- - (<tt>Boolean</tt>) <strong>check_valid?</strong>(value)
416
-
417
-
418
-
419
-
420
-
421
- </h3><div class="docstring">
422
- <div class="discussion">
423
-
424
-
425
-
426
- </div>
427
- </div>
428
- <div class="tags">
429
-
430
- <p class="tag_title">Returns:</p>
431
- <ul class="return">
432
-
433
- <li>
434
-
435
-
436
- <span class='type'>(<tt>Boolean</tt>)</span>
437
-
438
-
439
-
440
- </li>
441
-
442
- </ul>
443
-
444
- </div><table class="source_code">
445
- <tr>
446
- <td>
447
- <pre class="lines">
448
-
449
-
450
- 138
451
- 139
452
- 140</pre>
453
- </td>
454
- <td>
455
- <pre class="code"><span class="info file"># File 'lib/apes/validators.rb', line 138</span>
456
-
457
- <span class='kw'>def</span> <span class='id identifier rubyid_check_valid?'>check_valid?</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span>
458
- <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_blank?'>blank?</span> <span class='op'>||</span> <span class='const'>TimestampValidator</span><span class='period'>.</span><span class='id identifier rubyid_parse'>parse</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='comma'>,</span> <span class='label'>formats:</span> <span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:formats</span><span class='rbracket'>]</span><span class='rparen'>)</span>
459
- <span class='kw'>end</span></pre>
460
- </td>
461
- </tr>
462
- </table>
463
- </div>
464
-
465
- </div>
466
-
467
- </div>
468
-
469
- <div id="footer">
470
- Generated on Sat May 21 09:55:15 2016 by
471
- <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
472
- 0.8.7.6 (ruby-2.3.0).
473
- </div>
474
-
475
- </body>
476
- </html>