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,463 +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
- Module: Concerns::PaginationHandling
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#!Concerns/PaginationHandling.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 (P)</a> &raquo;
35
- <span class='title'><span class='object_link'><a href="../Concerns.html" title="Concerns (module)">Concerns</a></span></span>
36
- &raquo;
37
- <span class="title">PaginationHandling</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: Concerns::PaginationHandling
67
-
68
-
69
-
70
- </h1>
71
-
72
- <dl class="box">
73
-
74
-
75
-
76
-
77
-
78
-
79
-
80
-
81
- <dt class="r1 last">Defined in:</dt>
82
- <dd class="r1 last">lib/apes/concerns/pagination.rb</dd>
83
-
84
- </dl>
85
- <div class="clear"></div>
86
-
87
-
88
-
89
-
90
-
91
-
92
-
93
-
94
-
95
- <h2>
96
- Instance Method Summary
97
- <small>(<a href="#" class="summary_toggle">collapse</a>)</small>
98
- </h2>
99
-
100
- <ul class="summary">
101
-
102
- <li class="public ">
103
- <span class="summary_signature">
104
-
105
- <a href="#paginate-instance_method" title="#paginate (instance method)">- (Object) <strong>paginate</strong>(collection, sort_field: :id, sort_order: :desc) </a>
106
-
107
-
108
-
109
- </span>
110
-
111
-
112
-
113
-
114
-
115
-
116
-
117
-
118
-
119
- <span class="summary_desc"><div class='inline'>
120
- </div></span>
121
-
122
- </li>
123
-
124
-
125
- <li class="public ">
126
- <span class="summary_signature">
127
-
128
- <a href="#pagination_field-instance_method" title="#pagination_field (instance method)">- (Object) <strong>pagination_field</strong> </a>
129
-
130
-
131
-
132
- </span>
133
-
134
-
135
-
136
-
137
-
138
-
139
-
140
-
141
-
142
- <span class="summary_desc"><div class='inline'>
143
- </div></span>
144
-
145
- </li>
146
-
147
-
148
- <li class="public ">
149
- <span class="summary_signature">
150
-
151
- <a href="#pagination_skip%3F-instance_method" title="#pagination_skip? (instance method)">- (Boolean) <strong>pagination_skip?</strong> </a>
152
-
153
-
154
-
155
- </span>
156
-
157
-
158
-
159
-
160
-
161
-
162
-
163
-
164
-
165
- <span class="summary_desc"><div class='inline'>
166
- </div></span>
167
-
168
- </li>
169
-
170
-
171
- <li class="public ">
172
- <span class="summary_signature">
173
-
174
- <a href="#pagination_supported%3F-instance_method" title="#pagination_supported? (instance method)">- (Boolean) <strong>pagination_supported?</strong> </a>
175
-
176
-
177
-
178
- </span>
179
-
180
-
181
-
182
-
183
-
184
-
185
-
186
-
187
-
188
- <span class="summary_desc"><div class='inline'>
189
- </div></span>
190
-
191
- </li>
192
-
193
-
194
- <li class="public ">
195
- <span class="summary_signature">
196
-
197
- <a href="#pagination_url-instance_method" title="#pagination_url (instance method)">- (Object) <strong>pagination_url</strong>(key = nil) </a>
198
-
199
-
200
-
201
- </span>
202
-
203
-
204
-
205
-
206
-
207
-
208
-
209
-
210
-
211
- <span class="summary_desc"><div class='inline'>
212
- </div></span>
213
-
214
- </li>
215
-
216
-
217
- </ul>
218
-
219
-
220
-
221
-
222
- <div id="instance_method_details" class="method_details_list">
223
- <h2>Instance Method Details</h2>
224
-
225
-
226
- <div class="method_details first">
227
- <h3 class="signature first" id="paginate-instance_method">
228
-
229
- - (<tt>Object</tt>) <strong>paginate</strong>(collection, sort_field: :id, sort_order: :desc)
230
-
231
-
232
-
233
-
234
-
235
- </h3><table class="source_code">
236
- <tr>
237
- <td>
238
- <pre class="lines">
239
-
240
-
241
- 8
242
- 9
243
- 10
244
- 11
245
- 12
246
- 13
247
- 14
248
- 15
249
- 16
250
- 17
251
- 18
252
- 19
253
- 20
254
- 21
255
- 22
256
- 23
257
- 24</pre>
258
- </td>
259
- <td>
260
- <pre class="code"><span class="info file"># File 'lib/apes/concerns/pagination.rb', line 8</span>
261
-
262
- <span class='kw'>def</span> <span class='id identifier rubyid_paginate'>paginate</span><span class='lparen'>(</span><span class='id identifier rubyid_collection'>collection</span><span class='comma'>,</span> <span class='label'>sort_field:</span> <span class='symbol'>:id</span><span class='comma'>,</span> <span class='label'>sort_order:</span> <span class='symbol'>:desc</span><span class='rparen'>)</span>
263
- <span class='id identifier rubyid_direction'>direction</span> <span class='op'>=</span> <span class='ivar'>@cursor</span><span class='period'>.</span><span class='id identifier rubyid_direction'>direction</span>
264
- <span class='id identifier rubyid_value'>value</span> <span class='op'>=</span> <span class='ivar'>@cursor</span><span class='period'>.</span><span class='id identifier rubyid_value'>value</span>
265
-
266
- <span class='comment'># Apply the query
267
- </span> <span class='id identifier rubyid_collection'>collection</span> <span class='op'>=</span> <span class='id identifier rubyid_apply_value'>apply_value</span><span class='lparen'>(</span><span class='id identifier rubyid_collection'>collection</span><span class='comma'>,</span> <span class='id identifier rubyid_value'>value</span><span class='comma'>,</span> <span class='id identifier rubyid_sort_field'>sort_field</span><span class='comma'>,</span> <span class='id identifier rubyid_sort_order'>sort_order</span><span class='rparen'>)</span>
268
- <span class='id identifier rubyid_collection'>collection</span> <span class='op'>=</span> <span class='id identifier rubyid_collection'>collection</span><span class='period'>.</span><span class='id identifier rubyid_limit'>limit</span><span class='lparen'>(</span><span class='ivar'>@cursor</span><span class='period'>.</span><span class='id identifier rubyid_size'>size</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_order'>order</span><span class='lparen'>(</span><span class='id identifier rubyid_sprintf'>sprintf</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>%s %s</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='id identifier rubyid_sort_field'>sort_field</span><span class='comma'>,</span> <span class='id identifier rubyid_sort_order'>sort_order</span><span class='period'>.</span><span class='id identifier rubyid_upcase'>upcase</span><span class='rparen'>)</span><span class='rparen'>)</span>
269
-
270
- <span class='comment'># If we&#39;re fetching previous we reverse the order to make sure we fetch the results adiacents to the previous request,
271
- </span> <span class='comment'># then we reverse results to ensure the order requested
272
- </span> <span class='kw'>if</span> <span class='id identifier rubyid_direction'>direction</span> <span class='op'>!=</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>next</span><span class='tstring_end'>&quot;</span></span>
273
- <span class='id identifier rubyid_collection'>collection</span> <span class='op'>=</span> <span class='id identifier rubyid_collection'>collection</span><span class='period'>.</span><span class='id identifier rubyid_reverse_order'>reverse_order</span>
274
- <span class='id identifier rubyid_collection'>collection</span> <span class='op'>=</span> <span class='id identifier rubyid_collection'>collection</span><span class='period'>.</span><span class='id identifier rubyid_reverse'>reverse</span>
275
- <span class='kw'>end</span>
276
-
277
- <span class='id identifier rubyid_collection'>collection</span>
278
- <span class='kw'>end</span></pre>
279
- </td>
280
- </tr>
281
- </table>
282
- </div>
283
-
284
- <div class="method_details ">
285
- <h3 class="signature " id="pagination_field-instance_method">
286
-
287
- - (<tt>Object</tt>) <strong>pagination_field</strong>
288
-
289
-
290
-
291
-
292
-
293
- </h3><table class="source_code">
294
- <tr>
295
- <td>
296
- <pre class="lines">
297
-
298
-
299
- 26
300
- 27
301
- 28</pre>
302
- </td>
303
- <td>
304
- <pre class="code"><span class="info file"># File 'lib/apes/concerns/pagination.rb', line 26</span>
305
-
306
- <span class='kw'>def</span> <span class='id identifier rubyid_pagination_field'>pagination_field</span>
307
- <span class='ivar'>@pagination_field</span> <span class='op'>||=</span> <span class='symbol'>:handle</span>
308
- <span class='kw'>end</span></pre>
309
- </td>
310
- </tr>
311
- </table>
312
- </div>
313
-
314
- <div class="method_details ">
315
- <h3 class="signature " id="pagination_skip?-instance_method">
316
-
317
- - (<tt>Boolean</tt>) <strong>pagination_skip?</strong>
318
-
319
-
320
-
321
-
322
-
323
- </h3><div class="docstring">
324
- <div class="discussion">
325
-
326
-
327
-
328
- </div>
329
- </div>
330
- <div class="tags">
331
-
332
- <p class="tag_title">Returns:</p>
333
- <ul class="return">
334
-
335
- <li>
336
-
337
-
338
- <span class='type'>(<tt>Boolean</tt>)</span>
339
-
340
-
341
-
342
- </li>
343
-
344
- </ul>
345
-
346
- </div><table class="source_code">
347
- <tr>
348
- <td>
349
- <pre class="lines">
350
-
351
-
352
- 30
353
- 31
354
- 32</pre>
355
- </td>
356
- <td>
357
- <pre class="code"><span class="info file"># File 'lib/apes/concerns/pagination.rb', line 30</span>
358
-
359
- <span class='kw'>def</span> <span class='id identifier rubyid_pagination_skip?'>pagination_skip?</span>
360
- <span class='ivar'>@skip_pagination</span>
361
- <span class='kw'>end</span></pre>
362
- </td>
363
- </tr>
364
- </table>
365
- </div>
366
-
367
- <div class="method_details ">
368
- <h3 class="signature " id="pagination_supported?-instance_method">
369
-
370
- - (<tt>Boolean</tt>) <strong>pagination_supported?</strong>
371
-
372
-
373
-
374
-
375
-
376
- </h3><div class="docstring">
377
- <div class="discussion">
378
-
379
-
380
-
381
- </div>
382
- </div>
383
- <div class="tags">
384
-
385
- <p class="tag_title">Returns:</p>
386
- <ul class="return">
387
-
388
- <li>
389
-
390
-
391
- <span class='type'>(<tt>Boolean</tt>)</span>
392
-
393
-
394
-
395
- </li>
396
-
397
- </ul>
398
-
399
- </div><table class="source_code">
400
- <tr>
401
- <td>
402
- <pre class="lines">
403
-
404
-
405
- 34
406
- 35
407
- 36</pre>
408
- </td>
409
- <td>
410
- <pre class="code"><span class="info file"># File 'lib/apes/concerns/pagination.rb', line 34</span>
411
-
412
- <span class='kw'>def</span> <span class='id identifier rubyid_pagination_supported?'>pagination_supported?</span>
413
- <span class='ivar'>@objects</span><span class='period'>.</span><span class='id identifier rubyid_respond_to?'>respond_to?</span><span class='lparen'>(</span><span class='symbol'>:first</span><span class='rparen'>)</span> <span class='op'>&amp;&amp;</span> <span class='ivar'>@objects</span><span class='period'>.</span><span class='id identifier rubyid_respond_to?'>respond_to?</span><span class='lparen'>(</span><span class='symbol'>:last</span><span class='rparen'>)</span>
414
- <span class='kw'>end</span></pre>
415
- </td>
416
- </tr>
417
- </table>
418
- </div>
419
-
420
- <div class="method_details ">
421
- <h3 class="signature " id="pagination_url-instance_method">
422
-
423
- - (<tt>Object</tt>) <strong>pagination_url</strong>(key = nil)
424
-
425
-
426
-
427
-
428
-
429
- </h3><table class="source_code">
430
- <tr>
431
- <td>
432
- <pre class="lines">
433
-
434
-
435
- 38
436
- 39
437
- 40
438
- 41</pre>
439
- </td>
440
- <td>
441
- <pre class="code"><span class="info file"># File 'lib/apes/concerns/pagination.rb', line 38</span>
442
-
443
- <span class='kw'>def</span> <span class='id identifier rubyid_pagination_url'>pagination_url</span><span class='lparen'>(</span><span class='id identifier rubyid_key'>key</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='rparen'>)</span>
444
- <span class='id identifier rubyid_exist'>exist</span> <span class='op'>=</span> <span class='ivar'>@cursor</span><span class='period'>.</span><span class='id identifier rubyid_might_exist?'>might_exist?</span><span class='lparen'>(</span><span class='id identifier rubyid_key'>key</span><span class='comma'>,</span> <span class='ivar'>@objects</span><span class='rparen'>)</span>
445
- <span class='id identifier rubyid_exist'>exist</span> <span class='op'>?</span> <span class='id identifier rubyid_url_for'>url_for</span><span class='lparen'>(</span><span class='id identifier rubyid_request'>request</span><span class='period'>.</span><span class='id identifier rubyid_params'>params</span><span class='period'>.</span><span class='id identifier rubyid_merge'>merge</span><span class='lparen'>(</span><span class='label'>page:</span> <span class='ivar'>@cursor</span><span class='period'>.</span><span class='id identifier rubyid_save'>save</span><span class='lparen'>(</span><span class='ivar'>@objects</span><span class='comma'>,</span> <span class='id identifier rubyid_key'>key</span><span class='comma'>,</span> <span class='label'>field:</span> <span class='id identifier rubyid_pagination_field'>pagination_field</span><span class='rparen'>)</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_merge'>merge</span><span class='lparen'>(</span><span class='label'>only_path:</span> <span class='kw'>false</span><span class='rparen'>)</span><span class='rparen'>)</span> <span class='op'>:</span> <span class='kw'>nil</span>
446
- <span class='kw'>end</span></pre>
447
- </td>
448
- </tr>
449
- </table>
450
- </div>
451
-
452
- </div>
453
-
454
- </div>
455
-
456
- <div id="footer">
457
- Generated on Sat May 21 11:01:52 2016 by
458
- <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
459
- 0.8.7.6 (ruby-2.3.0).
460
- </div>
461
-
462
- </body>
463
- </html>