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,764 +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: PaginationCursor
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#!PaginationCursor.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
-
36
-
37
- <span class="title">PaginationCursor</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: PaginationCursor
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">Object</span>
77
-
78
- <ul class="fullTree">
79
- <li>Object</li>
80
-
81
- <li class="next">PaginationCursor</li>
82
-
83
- </ul>
84
- <a href="#" class="inheritanceTree">show all</a>
85
-
86
- </dd>
87
-
88
-
89
-
90
-
91
-
92
-
93
-
94
-
95
-
96
- <dt class="r2 last">Defined in:</dt>
97
- <dd class="r2 last">lib/apes/pagination_cursor.rb</dd>
98
-
99
- </dl>
100
- <div class="clear"></div>
101
-
102
- <h2>Overview</h2><div class="docstring">
103
- <div class="discussion">
104
- <p>This file is part of the apes gem. Copyright (C) 2016 and above Shogun <a href="&#109;&#097;&#105;&#108;&#116;&#111;:&#115;&#104;&#111;&#103;&#117;&#110;&#064;&#099;&#111;&#119;&#116;&#101;&#099;&#104;&#046;&#105;&#116;">&#115;&#104;&#111;&#103;&#117;&#110;&#064;&#099;&#111;&#119;&#116;&#101;&#099;&#104;&#046;&#105;&#116;</a>.
105
- Licensed under the MIT license, which can be found at http://www.opensource.org/licenses/mit-license.php.</p>
106
-
107
-
108
- </div>
109
- </div>
110
- <div class="tags">
111
-
112
-
113
- </div>
114
- <h2>Constant Summary</h2>
115
-
116
- <dl class="constants">
117
-
118
- <dt id="DEFAULT_SIZE-constant" class="">DEFAULT_SIZE =
119
-
120
- </dt>
121
- <dd><pre class="code"><span class='int'>25</span></pre></dd>
122
-
123
- <dt id="TIMESTAMP_FORMAT-constant" class="">TIMESTAMP_FORMAT =
124
-
125
- </dt>
126
- <dd><pre class="code"><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>%FT%T.%6N%z</span><span class='tstring_end'>&quot;</span></span><span class='period'>.</span><span class='id identifier rubyid_freeze'>freeze</span></pre></dd>
127
-
128
- </dl>
129
-
130
-
131
-
132
-
133
-
134
- <h2>Instance Attribute Summary <small>(<a href="#" class="summary_toggle">collapse</a>)</small></h2>
135
- <ul class="summary">
136
-
137
- <li class="public ">
138
- <span class="summary_signature">
139
-
140
- <a href="#direction-instance_method" title="#direction (instance method)">- (Object) <strong>direction</strong> </a>
141
-
142
-
143
-
144
- </span>
145
-
146
-
147
-
148
-
149
- <span class="note title readonly">readonly</span>
150
-
151
-
152
-
153
-
154
-
155
-
156
-
157
-
158
-
159
- <span class="summary_desc"><div class='inline'><p>Returns the value of attribute direction.</p>
160
- </div></span>
161
-
162
- </li>
163
-
164
-
165
- <li class="public ">
166
- <span class="summary_signature">
167
-
168
- <a href="#size-instance_method" title="#size (instance method)">- (Object) <strong>size</strong> </a>
169
-
170
-
171
-
172
- </span>
173
-
174
-
175
-
176
-
177
- <span class="note title readonly">readonly</span>
178
-
179
-
180
-
181
-
182
-
183
-
184
-
185
-
186
-
187
- <span class="summary_desc"><div class='inline'><p>Returns the value of attribute size.</p>
188
- </div></span>
189
-
190
- </li>
191
-
192
-
193
- <li class="public ">
194
- <span class="summary_signature">
195
-
196
- <a href="#use_offset-instance_method" title="#use_offset (instance method)">- (Object) <strong>use_offset</strong> </a>
197
-
198
-
199
-
200
- </span>
201
-
202
-
203
-
204
-
205
- <span class="note title readonly">readonly</span>
206
-
207
-
208
-
209
-
210
-
211
-
212
-
213
-
214
-
215
- <span class="summary_desc"><div class='inline'><p>Returns the value of attribute use_offset.</p>
216
- </div></span>
217
-
218
- </li>
219
-
220
-
221
- <li class="public ">
222
- <span class="summary_signature">
223
-
224
- <a href="#value-instance_method" title="#value (instance method)">- (Object) <strong>value</strong> </a>
225
-
226
-
227
-
228
- </span>
229
-
230
-
231
-
232
-
233
- <span class="note title readonly">readonly</span>
234
-
235
-
236
-
237
-
238
-
239
-
240
-
241
-
242
-
243
- <span class="summary_desc"><div class='inline'><p>Returns the value of attribute value.</p>
244
- </div></span>
245
-
246
- </li>
247
-
248
-
249
- </ul>
250
-
251
-
252
-
253
-
254
-
255
- <h2>
256
- Instance Method Summary
257
- <small>(<a href="#" class="summary_toggle">collapse</a>)</small>
258
- </h2>
259
-
260
- <ul class="summary">
261
-
262
- <li class="public ">
263
- <span class="summary_signature">
264
-
265
- <a href="#initialize-instance_method" title="#initialize (instance method)">- (PaginationCursor) <strong>initialize</strong>(params = {}, field = :page, count_field = :count) </a>
266
-
267
-
268
-
269
- </span>
270
-
271
-
272
- <span class="note title constructor">constructor</span>
273
-
274
-
275
-
276
-
277
-
278
-
279
-
280
-
281
- <span class="summary_desc"><div class='inline'><p>A new instance of PaginationCursor.</p>
282
- </div></span>
283
-
284
- </li>
285
-
286
-
287
- <li class="public ">
288
- <span class="summary_signature">
289
-
290
- <a href="#might_exist%3F-instance_method" title="#might_exist? (instance method)">- (Boolean) <strong>might_exist?</strong>(type, collection) </a>
291
-
292
-
293
-
294
- </span>
295
-
296
-
297
-
298
-
299
-
300
-
301
-
302
-
303
-
304
- <span class="summary_desc"><div class='inline'>
305
- </div></span>
306
-
307
- </li>
308
-
309
-
310
- <li class="public ">
311
- <span class="summary_signature">
312
-
313
- <a href="#operator-instance_method" title="#operator (instance method)">- (Object) <strong>operator</strong>(order) </a>
314
-
315
-
316
-
317
- </span>
318
-
319
-
320
-
321
-
322
-
323
-
324
-
325
-
326
-
327
- <span class="summary_desc"><div class='inline'>
328
- </div></span>
329
-
330
- </li>
331
-
332
-
333
- <li class="public ">
334
- <span class="summary_signature">
335
-
336
- <a href="#save-instance_method" title="#save (instance method)">- (Object) <strong>save</strong>(collection, type, field: :id, size: nil, use_offset: nil) </a>
337
-
338
-
339
-
340
- (also: #serialize)
341
-
342
- </span>
343
-
344
-
345
-
346
-
347
-
348
-
349
-
350
-
351
-
352
- <span class="summary_desc"><div class='inline'>
353
- </div></span>
354
-
355
- </li>
356
-
357
-
358
- </ul>
359
-
360
-
361
- <div id="constructor_details" class="method_details_list">
362
- <h2>Constructor Details</h2>
363
-
364
- <div class="method_details first">
365
- <h3 class="signature first" id="initialize-instance_method">
366
-
367
- - (<tt><span class='object_link'><a href="" title="PaginationCursor (class)">PaginationCursor</a></span></tt>) <strong>initialize</strong>(params = {}, field = :page, count_field = :count)
368
-
369
-
370
-
371
-
372
-
373
- </h3><div class="docstring">
374
- <div class="discussion">
375
- <p>Returns a new instance of PaginationCursor</p>
376
-
377
-
378
- </div>
379
- </div>
380
- <div class="tags">
381
-
382
-
383
- </div><table class="source_code">
384
- <tr>
385
- <td>
386
- <pre class="lines">
387
-
388
-
389
- 12
390
- 13
391
- 14
392
- 15
393
- 16
394
- 17
395
- 18
396
- 19
397
- 20
398
- 21
399
- 22
400
- 23</pre>
401
- </td>
402
- <td>
403
- <pre class="code"><span class="info file"># File 'lib/apes/pagination_cursor.rb', line 12</span>
404
-
405
- <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='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='comma'>,</span> <span class='id identifier rubyid_field'>field</span> <span class='op'>=</span> <span class='symbol'>:page</span><span class='comma'>,</span> <span class='id identifier rubyid_count_field'>count_field</span> <span class='op'>=</span> <span class='symbol'>:count</span><span class='rparen'>)</span>
406
- <span class='kw'>begin</span>
407
- <span class='id identifier rubyid_payload'>payload</span> <span class='op'>=</span> <span class='const'>JWT</span><span class='period'>.</span><span class='id identifier rubyid_decode'>decode</span><span class='lparen'>(</span><span class='id identifier rubyid_params'>params</span><span class='lbracket'>[</span><span class='id identifier rubyid_field'>field</span><span class='rbracket'>]</span><span class='comma'>,</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_secrets'>secrets</span><span class='period'>.</span><span class='id identifier rubyid_jwt'>jwt</span><span class='comma'>,</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='lbrace'>{</span><span class='label'>algorithm:</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>HS256</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='label'>verify_aud:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>aud:</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>pagination</span><span class='tstring_end'>&quot;</span></span><span class='rbrace'>}</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_dig'>dig</span><span class='lparen'>(</span><span class='int'>0</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>sub</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span>
408
-
409
- <span class='id identifier rubyid_extract_payload'>extract_payload</span><span class='lparen'>(</span><span class='id identifier rubyid_payload'>payload</span><span class='rparen'>)</span>
410
- <span class='kw'>rescue</span>
411
- <span class='id identifier rubyid_default_payload'>default_payload</span>
412
- <span class='kw'>end</span>
413
-
414
- <span class='comment'># Sanitization
415
- </span> <span class='id identifier rubyid_sanitize'>sanitize</span><span class='lparen'>(</span><span class='id identifier rubyid_count_field'>count_field</span><span class='comma'>,</span> <span class='id identifier rubyid_params'>params</span><span class='rparen'>)</span>
416
- <span class='kw'>end</span></pre>
417
- </td>
418
- </tr>
419
- </table>
420
- </div>
421
-
422
- </div>
423
-
424
- <div id="instance_attr_details" class="attr_details">
425
- <h2>Instance Attribute Details</h2>
426
-
427
-
428
- <span id=""></span>
429
- <div class="method_details first">
430
- <h3 class="signature first" id="direction-instance_method">
431
-
432
- - (<tt>Object</tt>) <strong>direction</strong> <span class="extras">(readonly)</span>
433
-
434
-
435
-
436
-
437
-
438
- </h3><div class="docstring">
439
- <div class="discussion">
440
- <p>Returns the value of attribute direction</p>
441
-
442
-
443
- </div>
444
- </div>
445
- <div class="tags">
446
-
447
-
448
- </div><table class="source_code">
449
- <tr>
450
- <td>
451
- <pre class="lines">
452
-
453
-
454
- 10
455
- 11
456
- 12</pre>
457
- </td>
458
- <td>
459
- <pre class="code"><span class="info file"># File 'lib/apes/pagination_cursor.rb', line 10</span>
460
-
461
- <span class='kw'>def</span> <span class='id identifier rubyid_direction'>direction</span>
462
- <span class='ivar'>@direction</span>
463
- <span class='kw'>end</span></pre>
464
- </td>
465
- </tr>
466
- </table>
467
- </div>
468
-
469
-
470
- <span id=""></span>
471
- <div class="method_details ">
472
- <h3 class="signature " id="size-instance_method">
473
-
474
- - (<tt>Object</tt>) <strong>size</strong> <span class="extras">(readonly)</span>
475
-
476
-
477
-
478
-
479
-
480
- </h3><div class="docstring">
481
- <div class="discussion">
482
- <p>Returns the value of attribute size</p>
483
-
484
-
485
- </div>
486
- </div>
487
- <div class="tags">
488
-
489
-
490
- </div><table class="source_code">
491
- <tr>
492
- <td>
493
- <pre class="lines">
494
-
495
-
496
- 10
497
- 11
498
- 12</pre>
499
- </td>
500
- <td>
501
- <pre class="code"><span class="info file"># File 'lib/apes/pagination_cursor.rb', line 10</span>
502
-
503
- <span class='kw'>def</span> <span class='id identifier rubyid_size'>size</span>
504
- <span class='ivar'>@size</span>
505
- <span class='kw'>end</span></pre>
506
- </td>
507
- </tr>
508
- </table>
509
- </div>
510
-
511
-
512
- <span id=""></span>
513
- <div class="method_details ">
514
- <h3 class="signature " id="use_offset-instance_method">
515
-
516
- - (<tt>Object</tt>) <strong>use_offset</strong> <span class="extras">(readonly)</span>
517
-
518
-
519
-
520
-
521
-
522
- </h3><div class="docstring">
523
- <div class="discussion">
524
- <p>Returns the value of attribute use_offset</p>
525
-
526
-
527
- </div>
528
- </div>
529
- <div class="tags">
530
-
531
-
532
- </div><table class="source_code">
533
- <tr>
534
- <td>
535
- <pre class="lines">
536
-
537
-
538
- 10
539
- 11
540
- 12</pre>
541
- </td>
542
- <td>
543
- <pre class="code"><span class="info file"># File 'lib/apes/pagination_cursor.rb', line 10</span>
544
-
545
- <span class='kw'>def</span> <span class='id identifier rubyid_use_offset'>use_offset</span>
546
- <span class='ivar'>@use_offset</span>
547
- <span class='kw'>end</span></pre>
548
- </td>
549
- </tr>
550
- </table>
551
- </div>
552
-
553
-
554
- <span id=""></span>
555
- <div class="method_details ">
556
- <h3 class="signature " id="value-instance_method">
557
-
558
- - (<tt>Object</tt>) <strong>value</strong> <span class="extras">(readonly)</span>
559
-
560
-
561
-
562
-
563
-
564
- </h3><div class="docstring">
565
- <div class="discussion">
566
- <p>Returns the value of attribute value</p>
567
-
568
-
569
- </div>
570
- </div>
571
- <div class="tags">
572
-
573
-
574
- </div><table class="source_code">
575
- <tr>
576
- <td>
577
- <pre class="lines">
578
-
579
-
580
- 10
581
- 11
582
- 12</pre>
583
- </td>
584
- <td>
585
- <pre class="code"><span class="info file"># File 'lib/apes/pagination_cursor.rb', line 10</span>
586
-
587
- <span class='kw'>def</span> <span class='id identifier rubyid_value'>value</span>
588
- <span class='ivar'>@value</span>
589
- <span class='kw'>end</span></pre>
590
- </td>
591
- </tr>
592
- </table>
593
- </div>
594
-
595
- </div>
596
-
597
-
598
- <div id="instance_method_details" class="method_details_list">
599
- <h2>Instance Method Details</h2>
600
-
601
-
602
- <div class="method_details first">
603
- <h3 class="signature first" id="might_exist?-instance_method">
604
-
605
- - (<tt>Boolean</tt>) <strong>might_exist?</strong>(type, collection)
606
-
607
-
608
-
609
-
610
-
611
- </h3><div class="docstring">
612
- <div class="discussion">
613
-
614
-
615
-
616
- </div>
617
- </div>
618
- <div class="tags">
619
-
620
- <p class="tag_title">Returns:</p>
621
- <ul class="return">
622
-
623
- <li>
624
-
625
-
626
- <span class='type'>(<tt>Boolean</tt>)</span>
627
-
628
-
629
-
630
- </li>
631
-
632
- </ul>
633
-
634
- </div><table class="source_code">
635
- <tr>
636
- <td>
637
- <pre class="lines">
638
-
639
-
640
- 33
641
- 34
642
- 35
643
- 36
644
- 37
645
- 38
646
- 39</pre>
647
- </td>
648
- <td>
649
- <pre class="code"><span class="info file"># File 'lib/apes/pagination_cursor.rb', line 33</span>
650
-
651
- <span class='kw'>def</span> <span class='id identifier rubyid_might_exist?'>might_exist?</span><span class='lparen'>(</span><span class='id identifier rubyid_type'>type</span><span class='comma'>,</span> <span class='id identifier rubyid_collection'>collection</span><span class='rparen'>)</span>
652
- <span class='kw'>case</span> <span class='id identifier rubyid_type'>type</span><span class='period'>.</span><span class='id identifier rubyid_ensure_string'>ensure_string</span>
653
- <span class='kw'>when</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>first</span><span class='tstring_end'>&quot;</span></span> <span class='kw'>then</span> <span class='kw'>true</span>
654
- <span class='kw'>when</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>next</span><span class='tstring_end'>&quot;</span></span> <span class='kw'>then</span> <span class='id identifier rubyid_collection'>collection</span><span class='period'>.</span><span class='id identifier rubyid_present?'>present?</span>
655
- <span class='kw'>else</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_present?'>present?</span> <span class='op'>&amp;&amp;</span> <span class='id identifier rubyid_collection'>collection</span><span class='period'>.</span><span class='id identifier rubyid_present?'>present?</span> <span class='comment'># Previous
656
- </span> <span class='kw'>end</span>
657
- <span class='kw'>end</span></pre>
658
- </td>
659
- </tr>
660
- </table>
661
- </div>
662
-
663
- <div class="method_details ">
664
- <h3 class="signature " id="operator-instance_method">
665
-
666
- - (<tt>Object</tt>) <strong>operator</strong>(order)
667
-
668
-
669
-
670
-
671
-
672
- </h3><table class="source_code">
673
- <tr>
674
- <td>
675
- <pre class="lines">
676
-
677
-
678
- 25
679
- 26
680
- 27
681
- 28
682
- 29
683
- 30
684
- 31</pre>
685
- </td>
686
- <td>
687
- <pre class="code"><span class="info file"># File 'lib/apes/pagination_cursor.rb', line 25</span>
688
-
689
- <span class='kw'>def</span> <span class='id identifier rubyid_operator'>operator</span><span class='lparen'>(</span><span class='id identifier rubyid_order'>order</span><span class='rparen'>)</span>
690
- <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>
691
- <span class='id identifier rubyid_order'>order</span> <span class='op'>==</span> <span class='symbol'>:asc</span> <span class='op'>?</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>&gt;</span><span class='tstring_end'>&quot;</span></span> <span class='op'>:</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>&lt;</span><span class='tstring_end'>&quot;</span></span> <span class='comment'># Descending order means newer results first
692
- </span> <span class='kw'>else</span>
693
- <span class='id identifier rubyid_order'>order</span> <span class='op'>==</span> <span class='symbol'>:asc</span> <span class='op'>?</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>&lt;</span><span class='tstring_end'>&quot;</span></span> <span class='op'>:</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>&gt;</span><span class='tstring_end'>&quot;</span></span> <span class='comment'># Descending order means newer results first
694
- </span> <span class='kw'>end</span>
695
- <span class='kw'>end</span></pre>
696
- </td>
697
- </tr>
698
- </table>
699
- </div>
700
-
701
- <div class="method_details ">
702
- <h3 class="signature " id="save-instance_method">
703
-
704
- - (<tt>Object</tt>) <strong>save</strong>(collection, type, field: :id, size: nil, use_offset: nil)
705
-
706
-
707
-
708
- <span class="aliases">Also known as:
709
- <span class="names"><span id='serialize-instance_method'>serialize</span></span>
710
- </span>
711
-
712
-
713
-
714
- </h3><table class="source_code">
715
- <tr>
716
- <td>
717
- <pre class="lines">
718
-
719
-
720
- 41
721
- 42
722
- 43
723
- 44
724
- 45
725
- 46
726
- 47
727
- 48
728
- 49
729
- 50
730
- 51
731
- 52</pre>
732
- </td>
733
- <td>
734
- <pre class="code"><span class="info file"># File 'lib/apes/pagination_cursor.rb', line 41</span>
735
-
736
- <span class='kw'>def</span> <span class='id identifier rubyid_save'>save</span><span class='lparen'>(</span><span class='id identifier rubyid_collection'>collection</span><span class='comma'>,</span> <span class='id identifier rubyid_type'>type</span><span class='comma'>,</span> <span class='label'>field:</span> <span class='symbol'>:id</span><span class='comma'>,</span> <span class='label'>size:</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='label'>use_offset:</span> <span class='kw'>nil</span><span class='rparen'>)</span>
737
- <span class='id identifier rubyid_size'>size</span> <span class='op'>||=</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_size'>size</span>
738
- <span class='id identifier rubyid_use_offset'>use_offset</span> <span class='op'>=</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_use_offset'>use_offset</span> <span class='kw'>if</span> <span class='id identifier rubyid_use_offset'>use_offset</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
739
- <span class='id identifier rubyid_direction'>direction</span><span class='comma'>,</span> <span class='id identifier rubyid_value'>value</span> <span class='op'>=</span> <span class='id identifier rubyid_use_offset'>use_offset</span> <span class='op'>?</span> <span class='id identifier rubyid_update_with_offset'>update_with_offset</span><span class='lparen'>(</span><span class='id identifier rubyid_type'>type</span><span class='comma'>,</span> <span class='id identifier rubyid_size'>size</span><span class='rparen'>)</span> <span class='op'>:</span> <span class='id identifier rubyid_update_with_field'>update_with_field</span><span class='lparen'>(</span><span class='id identifier rubyid_type'>type</span><span class='comma'>,</span> <span class='id identifier rubyid_collection'>collection</span><span class='comma'>,</span> <span class='id identifier rubyid_field'>field</span><span class='rparen'>)</span>
740
-
741
- <span class='id identifier rubyid_value'>value</span> <span class='op'>=</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_strftime'>strftime</span><span class='lparen'>(</span><span class='const'>TIMESTAMP_FORMAT</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_respond_to?'>respond_to?</span><span class='lparen'>(</span><span class='symbol'>:strftime</span><span class='rparen'>)</span>
742
-
743
- <span class='const'>JWT</span><span class='period'>.</span><span class='id identifier rubyid_encode'>encode</span><span class='lparen'>(</span>
744
- <span class='lbrace'>{</span><span class='label'>aud:</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>pagination</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='label'>sub:</span> <span class='lbrace'>{</span><span class='label'>value:</span> <span class='id identifier rubyid_value'>value</span><span class='comma'>,</span> <span class='label'>use_offset:</span> <span class='id identifier rubyid_use_offset'>use_offset</span><span class='comma'>,</span> <span class='label'>direction:</span> <span class='id identifier rubyid_direction'>direction</span><span class='comma'>,</span> <span class='label'>size:</span> <span class='id identifier rubyid_size'>size</span><span class='rbrace'>}</span><span class='rbrace'>}</span><span class='comma'>,</span>
745
- <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_secrets'>secrets</span><span class='period'>.</span><span class='id identifier rubyid_jwt'>jwt</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>HS256</span><span class='tstring_end'>&quot;</span></span>
746
- <span class='rparen'>)</span>
747
- <span class='kw'>end</span></pre>
748
- </td>
749
- </tr>
750
- </table>
751
- </div>
752
-
753
- </div>
754
-
755
- </div>
756
-
757
- <div id="footer">
758
- Generated on Sat May 21 09:16:38 2016 by
759
- <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
760
- 0.8.7.6 (ruby-2.3.0).
761
- </div>
762
-
763
- </body>
764
- </html>