ballast 2.2.4 → 2.2.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (86) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +6 -1
  3. data/.travis-gemfile +2 -2
  4. data/.travis.yml +5 -3
  5. data/.yardopts +1 -1
  6. data/CHANGELOG.md +9 -0
  7. data/Gemfile +1 -1
  8. data/LICENSE.md +21 -0
  9. data/README.md +22 -17
  10. data/Rakefile +1 -1
  11. data/ballast.gemspec +1 -1
  12. data/{doc → docs}/Ballast.html +19 -21
  13. data/docs/Ballast/AjaxResponse.html +1470 -0
  14. data/{doc → docs}/Ballast/Concerns.html +3 -3
  15. data/{doc → docs}/Ballast/Concerns/AjaxHandling.html +33 -38
  16. data/{doc → docs}/Ballast/Concerns/Common.html +45 -52
  17. data/{doc → docs}/Ballast/Concerns/ErrorsHandling.html +13 -14
  18. data/docs/Ballast/Concerns/JSONApi.html +127 -0
  19. data/docs/Ballast/Concerns/JSONApi/PaginationHandling.html +617 -0
  20. data/docs/Ballast/Concerns/JSONApi/RequestHandling.html +775 -0
  21. data/docs/Ballast/Concerns/JSONApi/ResponseHandling.html +917 -0
  22. data/{doc → docs}/Ballast/Concerns/View.html +35 -42
  23. data/{doc → docs}/Ballast/Configuration.html +19 -22
  24. data/{doc → docs}/Ballast/Emoji.html +1 -1
  25. data/{doc → docs}/Ballast/Emoji/Character.html +15 -18
  26. data/docs/Ballast/Emoji/Utils.html +794 -0
  27. data/{doc → docs}/Ballast/Errors.html +1 -1
  28. data/{doc → docs}/Ballast/Errors/Base.html +16 -18
  29. data/{doc → docs}/Ballast/Errors/Failure.html +1 -1
  30. data/{doc → docs}/Ballast/Errors/InvalidDomain.html +1 -1
  31. data/{doc → docs}/Ballast/Errors/ValidationFailure.html +1 -1
  32. data/{doc → docs}/Ballast/Middlewares.html +1 -1
  33. data/{doc → docs}/Ballast/Middlewares/DefaultHost.html +16 -18
  34. data/docs/Ballast/RequestDomainMatcher.html +917 -0
  35. data/docs/Ballast/Service.html +1513 -0
  36. data/docs/Ballast/Service/Response.html +1270 -0
  37. data/{doc → docs}/Ballast/Version.html +5 -9
  38. data/{doc → docs}/_index.html +45 -1
  39. data/docs/class_list.html +58 -0
  40. data/{doc → docs}/css/common.css +0 -0
  41. data/{doc → docs}/css/full_list.css +0 -0
  42. data/{doc → docs}/css/style.css +0 -0
  43. data/{doc → docs}/file.README.html +7 -5
  44. data/{doc → docs}/file_list.html +0 -0
  45. data/{doc → docs}/frames.html +0 -0
  46. data/{doc → docs}/index.html +7 -5
  47. data/{doc → docs}/js/app.js +0 -0
  48. data/{doc → docs}/js/full_list.js +0 -0
  49. data/{doc → docs}/js/jquery.js +0 -0
  50. data/{doc → docs}/method_list.html +150 -36
  51. data/docs/top-level-namespace.html +149 -0
  52. data/lib/ballast.rb +1 -1
  53. data/lib/ballast/ajax_response.rb +1 -1
  54. data/lib/ballast/concerns/ajax_handling.rb +1 -1
  55. data/lib/ballast/concerns/common.rb +1 -1
  56. data/lib/ballast/concerns/errors_handling.rb +1 -1
  57. data/lib/ballast/concerns/json_api/pagination_handling.rb +83 -0
  58. data/lib/ballast/concerns/json_api/request_handling.rb +235 -0
  59. data/lib/ballast/concerns/json_api/response_handling.rb +70 -0
  60. data/lib/ballast/concerns/view.rb +1 -1
  61. data/lib/ballast/configuration.rb +1 -1
  62. data/lib/ballast/emoji.rb +1 -1
  63. data/lib/ballast/errors.rb +1 -1
  64. data/lib/ballast/middlewares/default_host.rb +1 -1
  65. data/lib/ballast/request_domain_matcher.rb +1 -1
  66. data/lib/ballast/service.rb +1 -1
  67. data/lib/ballast/version.rb +2 -2
  68. data/spec/ballast/ajax_response_spec.rb +1 -1
  69. data/spec/ballast/concerns/ajax_handling_spec.rb +1 -1
  70. data/spec/ballast/concerns/common_spec.rb +1 -1
  71. data/spec/ballast/concerns/errors_handling_spec.rb +1 -1
  72. data/spec/ballast/concerns/view_spec.rb +1 -1
  73. data/spec/ballast/configuration_spec.rb +1 -1
  74. data/spec/ballast/errors_spec.rb +1 -1
  75. data/spec/ballast/middlewares/default_host_spec.rb +1 -1
  76. data/spec/ballast/request_domain_matcher_spec.rb +1 -1
  77. data/spec/ballast_spec.rb +1 -1
  78. data/spec/spec_helper.rb +1 -1
  79. metadata +47 -39
  80. data/doc/Ballast/AjaxResponse.html +0 -1478
  81. data/doc/Ballast/Emoji/Utils.html +0 -799
  82. data/doc/Ballast/RequestDomainMatcher.html +0 -923
  83. data/doc/Ballast/Service.html +0 -1522
  84. data/doc/Ballast/Service/Response.html +0 -1278
  85. data/doc/class_list.html +0 -58
  86. data/doc/top-level-namespace.html +0 -112
@@ -0,0 +1,917 @@
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: Ballast::Concerns::JSONApi::ResponseHandling
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#!Ballast/Concerns/JSONApi/ResponseHandling.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 (R)</a> &raquo;
35
+ <span class='title'><span class='object_link'><a href="../../../Ballast.html" title="Ballast (module)">Ballast</a></span></span> &raquo; <span class='title'><span class='object_link'><a href="../../Concerns.html" title="Ballast::Concerns (module)">Concerns</a></span></span> &raquo; <span class='title'><span class='object_link'><a href="../JSONApi.html" title="Ballast::Concerns::JSONApi (module)">JSONApi</a></span></span>
36
+ &raquo;
37
+ <span class="title">ResponseHandling</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: Ballast::Concerns::JSONApi::ResponseHandling
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/ballast/concerns/json_api/response_handling.rb</dd>
83
+
84
+ </dl>
85
+ <div class="clear"></div>
86
+
87
+ <h2>Overview</h2><div class="docstring">
88
+ <div class="discussion">
89
+ <p>A concern to handle JSON API responses.</p>
90
+
91
+
92
+ </div>
93
+ </div>
94
+ <div class="tags">
95
+
96
+
97
+ </div>
98
+
99
+
100
+
101
+ <h2>Instance Attribute Summary <small>(<a href="#" class="summary_toggle">collapse</a>)</small></h2>
102
+ <ul class="summary">
103
+
104
+ <li class="public ">
105
+ <span class="summary_signature">
106
+
107
+ <a href="#included-instance_method" title="#included (instance method)">- (Object) <strong>included</strong> </a>
108
+
109
+
110
+
111
+ </span>
112
+
113
+
114
+
115
+
116
+
117
+
118
+
119
+
120
+
121
+
122
+
123
+
124
+ <span class="summary_desc"><div class='inline'><p>Returns the value of attribute included.</p>
125
+ </div></span>
126
+
127
+ </li>
128
+
129
+
130
+ </ul>
131
+
132
+
133
+
134
+
135
+
136
+ <h2>
137
+ Instance Method Summary
138
+ <small>(<a href="#" class="summary_toggle">collapse</a>)</small>
139
+ </h2>
140
+
141
+ <ul class="summary">
142
+
143
+ <li class="public ">
144
+ <span class="summary_signature">
145
+
146
+ <a href="#response_data-instance_method" title="#response_data (instance method)">- (HashWithIndifferentAccess) <strong>response_data</strong>(default = nil) </a>
147
+
148
+
149
+
150
+ </span>
151
+
152
+
153
+
154
+
155
+
156
+
157
+
158
+
159
+
160
+ <span class="summary_desc"><div class='inline'><p>Returns the data for the current response.</p>
161
+ </div></span>
162
+
163
+ </li>
164
+
165
+
166
+ <li class="public ">
167
+ <span class="summary_signature">
168
+
169
+ <a href="#response_include-instance_method" title="#response_include (instance method)">- (HashWithIndifferentAccess) <strong>response_include</strong>(object, template = nil) </a>
170
+
171
+
172
+
173
+ </span>
174
+
175
+
176
+
177
+
178
+
179
+
180
+
181
+
182
+
183
+ <span class="summary_desc"><div class='inline'><p>Adds a object to the set of included objects.</p>
184
+ </div></span>
185
+
186
+ </li>
187
+
188
+
189
+ <li class="public ">
190
+ <span class="summary_signature">
191
+
192
+ <a href="#response_included-instance_method" title="#response_included (instance method)">- (HashWithIndifferentAccess) <strong>response_included</strong>(default = nil) </a>
193
+
194
+
195
+
196
+ </span>
197
+
198
+
199
+
200
+
201
+
202
+
203
+
204
+
205
+
206
+ <span class="summary_desc"><div class='inline'><p>Returns the additionally included objects for the current response.</p>
207
+ </div></span>
208
+
209
+ </li>
210
+
211
+
212
+ <li class="public ">
213
+ <span class="summary_signature">
214
+
215
+ <a href="#response_links-instance_method" title="#response_links (instance method)">- (HashWithIndifferentAccess) <strong>response_links</strong>(default = nil) </a>
216
+
217
+
218
+
219
+ </span>
220
+
221
+
222
+
223
+
224
+
225
+
226
+
227
+
228
+
229
+ <span class="summary_desc"><div class='inline'><p>Returns the links for the current response.</p>
230
+ </div></span>
231
+
232
+ </li>
233
+
234
+
235
+ <li class="public ">
236
+ <span class="summary_signature">
237
+
238
+ <a href="#response_meta-instance_method" title="#response_meta (instance method)">- (HashWithIndifferentAccess) <strong>response_meta</strong>(default = nil) </a>
239
+
240
+
241
+
242
+ </span>
243
+
244
+
245
+
246
+
247
+
248
+
249
+
250
+
251
+
252
+ <span class="summary_desc"><div class='inline'><p>Returns the metadata for the current response.</p>
253
+ </div></span>
254
+
255
+ </li>
256
+
257
+
258
+ <li class="public ">
259
+ <span class="summary_signature">
260
+
261
+ <a href="#response_template_for-instance_method" title="#response_template_for (instance method)">- (String) <strong>response_template_for</strong>(object) </a>
262
+
263
+
264
+
265
+ </span>
266
+
267
+
268
+
269
+
270
+
271
+
272
+
273
+
274
+
275
+ <span class="summary_desc"><div class='inline'><p>Returns the template for a object.</p>
276
+ </div></span>
277
+
278
+ </li>
279
+
280
+
281
+ <li class="public ">
282
+ <span class="summary_signature">
283
+
284
+ <a href="#response_timestamp-instance_method" title="#response_timestamp (instance method)">- (String) <strong>response_timestamp</strong>(timestamp) </a>
285
+
286
+
287
+
288
+ </span>
289
+
290
+
291
+
292
+
293
+
294
+
295
+
296
+
297
+
298
+ <span class="summary_desc"><div class='inline'><p>Formats a timestamp in ISO 8601 format.</p>
299
+ </div></span>
300
+
301
+ </li>
302
+
303
+
304
+ </ul>
305
+
306
+
307
+
308
+ <div id="instance_attr_details" class="attr_details">
309
+ <h2>Instance Attribute Details</h2>
310
+
311
+
312
+ <span id="included=-instance_method"></span>
313
+ <div class="method_details first">
314
+ <h3 class="signature first" id="included-instance_method">
315
+
316
+ - (<tt>Object</tt>) <strong>included</strong>
317
+
318
+
319
+
320
+
321
+
322
+ </h3><div class="docstring">
323
+ <div class="discussion">
324
+ <p>Returns the value of attribute included</p>
325
+
326
+
327
+ </div>
328
+ </div>
329
+ <div class="tags">
330
+
331
+
332
+ </div><table class="source_code">
333
+ <tr>
334
+ <td>
335
+ <pre class="lines">
336
+
337
+
338
+ 6
339
+ 7
340
+ 8</pre>
341
+ </td>
342
+ <td>
343
+ <pre class="code"><span class="info file"># File 'lib/ballast/concerns/json_api/response_handling.rb', line 6</span>
344
+
345
+ <span class='kw'>def</span> <span class='id identifier rubyid_included'>included</span>
346
+ <span class='ivar'>@included</span>
347
+ <span class='kw'>end</span></pre>
348
+ </td>
349
+ </tr>
350
+ </table>
351
+ </div>
352
+
353
+ </div>
354
+
355
+
356
+ <div id="instance_method_details" class="method_details_list">
357
+ <h2>Instance Method Details</h2>
358
+
359
+
360
+ <div class="method_details first">
361
+ <h3 class="signature first" id="response_data-instance_method">
362
+
363
+ - (<tt>HashWithIndifferentAccess</tt>) <strong>response_data</strong>(default = nil)
364
+
365
+
366
+
367
+
368
+
369
+ </h3><div class="docstring">
370
+ <div class="discussion">
371
+ <p>Returns the data for the current response.</p>
372
+
373
+
374
+ </div>
375
+ </div>
376
+ <div class="tags">
377
+ <p class="tag_title">Parameters:</p>
378
+ <ul class="param">
379
+
380
+ <li>
381
+
382
+ <span class='name'>default</span>
383
+
384
+
385
+ <span class='type'>(<tt>Object|NilClass</tt>)</span>
386
+
387
+
388
+ <em class="default">(defaults to: <tt>nil</tt>)</em>
389
+
390
+
391
+ &mdash;
392
+ <div class='inline'><p>The default data to return if nothing is set.</p>
393
+ </div>
394
+
395
+ </li>
396
+
397
+ </ul>
398
+
399
+ <p class="tag_title">Returns:</p>
400
+ <ul class="return">
401
+
402
+ <li>
403
+
404
+
405
+ <span class='type'>(<tt>HashWithIndifferentAccess</tt>)</span>
406
+
407
+
408
+
409
+ &mdash;
410
+ <div class='inline'><p>The data for the current response.</p>
411
+ </div>
412
+
413
+ </li>
414
+
415
+ </ul>
416
+
417
+ </div><table class="source_code">
418
+ <tr>
419
+ <td>
420
+ <pre class="lines">
421
+
422
+
423
+ 29
424
+ 30
425
+ 31</pre>
426
+ </td>
427
+ <td>
428
+ <pre class="code"><span class="info file"># File 'lib/ballast/concerns/json_api/response_handling.rb', line 29</span>
429
+
430
+ <span class='kw'>def</span> <span class='id identifier rubyid_response_data'>response_data</span><span class='lparen'>(</span><span class='id identifier rubyid_default'>default</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='rparen'>)</span>
431
+ <span class='ivar'>@data</span> <span class='op'>||</span> <span class='id identifier rubyid_default'>default</span> <span class='op'>||</span> <span class='const'>HashWithIndifferentAccess</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
432
+ <span class='kw'>end</span></pre>
433
+ </td>
434
+ </tr>
435
+ </table>
436
+ </div>
437
+
438
+ <div class="method_details ">
439
+ <h3 class="signature " id="response_include-instance_method">
440
+
441
+ - (<tt>HashWithIndifferentAccess</tt>) <strong>response_include</strong>(object, template = nil)
442
+
443
+
444
+
445
+
446
+
447
+ </h3><div class="docstring">
448
+ <div class="discussion">
449
+ <p>Adds a object to the set of included objects.</p>
450
+
451
+
452
+ </div>
453
+ </div>
454
+ <div class="tags">
455
+ <p class="tag_title">Parameters:</p>
456
+ <ul class="param">
457
+
458
+ <li>
459
+
460
+ <span class='name'>object</span>
461
+
462
+
463
+ <span class='type'>(<tt>Object</tt>)</span>
464
+
465
+
466
+
467
+ &mdash;
468
+ <div class='inline'><p>The object to include.</p>
469
+ </div>
470
+
471
+ </li>
472
+
473
+ <li>
474
+
475
+ <span class='name'>template</span>
476
+
477
+
478
+ <span class='type'>(<tt>String|Nilclass</tt>)</span>
479
+
480
+
481
+ <em class="default">(defaults to: <tt>nil</tt>)</em>
482
+
483
+
484
+ &mdash;
485
+ <div class='inline'><p>The template to use for rendering. If not set, it’s guessed from object class.</p>
486
+ </div>
487
+
488
+ </li>
489
+
490
+ </ul>
491
+
492
+ <p class="tag_title">Returns:</p>
493
+ <ul class="return">
494
+
495
+ <li>
496
+
497
+
498
+ <span class='type'>(<tt>HashWithIndifferentAccess</tt>)</span>
499
+
500
+
501
+
502
+ &mdash;
503
+ <div class='inline'><p>The new set of included objects.</p>
504
+ </div>
505
+
506
+ </li>
507
+
508
+ </ul>
509
+
510
+ </div><table class="source_code">
511
+ <tr>
512
+ <td>
513
+ <pre class="lines">
514
+
515
+
516
+ 54
517
+ 55
518
+ 56
519
+ 57
520
+ 58</pre>
521
+ </td>
522
+ <td>
523
+ <pre class="code"><span class="info file"># File 'lib/ballast/concerns/json_api/response_handling.rb', line 54</span>
524
+
525
+ <span class='kw'>def</span> <span class='id identifier rubyid_response_include'>response_include</span><span class='lparen'>(</span><span class='id identifier rubyid_object'>object</span><span class='comma'>,</span> <span class='id identifier rubyid_template'>template</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='rparen'>)</span>
526
+ <span class='id identifier rubyid_controller'>controller</span><span class='period'>.</span><span class='id identifier rubyid_included'>included</span> <span class='op'>||=</span> <span class='const'>HashWithIndifferentAccess</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
527
+ <span class='id identifier rubyid_controller'>controller</span><span class='period'>.</span><span class='id identifier rubyid_included'>included</span><span class='lbracket'>[</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_response_template_for'>response_template_for</span><span class='lparen'>(</span><span class='id identifier rubyid_object'>object</span><span class='rparen'>)</span><span class='comma'>,</span> <span class='id identifier rubyid_object'>object</span><span class='period'>.</span><span class='id identifier rubyid_to_param'>to_param</span><span class='rparen'>)</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='id identifier rubyid_object'>object</span><span class='comma'>,</span> <span class='id identifier rubyid_template'>template</span><span class='rbracket'>]</span>
528
+ <span class='id identifier rubyid_controller'>controller</span><span class='period'>.</span><span class='id identifier rubyid_included'>included</span>
529
+ <span class='kw'>end</span></pre>
530
+ </td>
531
+ </tr>
532
+ </table>
533
+ </div>
534
+
535
+ <div class="method_details ">
536
+ <h3 class="signature " id="response_included-instance_method">
537
+
538
+ - (<tt>HashWithIndifferentAccess</tt>) <strong>response_included</strong>(default = nil)
539
+
540
+
541
+
542
+
543
+
544
+ </h3><div class="docstring">
545
+ <div class="discussion">
546
+ <p>Returns the additionally included objects for the current response.</p>
547
+
548
+
549
+ </div>
550
+ </div>
551
+ <div class="tags">
552
+ <p class="tag_title">Parameters:</p>
553
+ <ul class="param">
554
+
555
+ <li>
556
+
557
+ <span class='name'>default</span>
558
+
559
+
560
+ <span class='type'>(<tt>Object|NilClass</tt>)</span>
561
+
562
+
563
+ <em class="default">(defaults to: <tt>nil</tt>)</em>
564
+
565
+
566
+ &mdash;
567
+ <div class='inline'><p>The default included objects to return if nothing is set.</p>
568
+ </div>
569
+
570
+ </li>
571
+
572
+ </ul>
573
+
574
+ <p class="tag_title">Returns:</p>
575
+ <ul class="return">
576
+
577
+ <li>
578
+
579
+
580
+ <span class='type'>(<tt>HashWithIndifferentAccess</tt>)</span>
581
+
582
+
583
+
584
+ &mdash;
585
+ <div class='inline'><p>The additionally included objects for the current response.</p>
586
+ </div>
587
+
588
+ </li>
589
+
590
+ </ul>
591
+
592
+ </div><table class="source_code">
593
+ <tr>
594
+ <td>
595
+ <pre class="lines">
596
+
597
+
598
+ 45
599
+ 46
600
+ 47</pre>
601
+ </td>
602
+ <td>
603
+ <pre class="code"><span class="info file"># File 'lib/ballast/concerns/json_api/response_handling.rb', line 45</span>
604
+
605
+ <span class='kw'>def</span> <span class='id identifier rubyid_response_included'>response_included</span><span class='lparen'>(</span><span class='id identifier rubyid_default'>default</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='rparen'>)</span>
606
+ <span class='id identifier rubyid_controller'>controller</span><span class='period'>.</span><span class='id identifier rubyid_included'>included</span> <span class='op'>||</span> <span class='id identifier rubyid_default'>default</span> <span class='op'>||</span> <span class='const'>HashWithIndifferentAccess</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
607
+ <span class='kw'>end</span></pre>
608
+ </td>
609
+ </tr>
610
+ </table>
611
+ </div>
612
+
613
+ <div class="method_details ">
614
+ <h3 class="signature " id="response_links-instance_method">
615
+
616
+ - (<tt>HashWithIndifferentAccess</tt>) <strong>response_links</strong>(default = nil)
617
+
618
+
619
+
620
+
621
+
622
+ </h3><div class="docstring">
623
+ <div class="discussion">
624
+ <p>Returns the links for the current response.</p>
625
+
626
+
627
+ </div>
628
+ </div>
629
+ <div class="tags">
630
+ <p class="tag_title">Parameters:</p>
631
+ <ul class="param">
632
+
633
+ <li>
634
+
635
+ <span class='name'>default</span>
636
+
637
+
638
+ <span class='type'>(<tt>Object|NilClass</tt>)</span>
639
+
640
+
641
+ <em class="default">(defaults to: <tt>nil</tt>)</em>
642
+
643
+
644
+ &mdash;
645
+ <div class='inline'><p>The default links to return if nothing is set.</p>
646
+ </div>
647
+
648
+ </li>
649
+
650
+ </ul>
651
+
652
+ <p class="tag_title">Returns:</p>
653
+ <ul class="return">
654
+
655
+ <li>
656
+
657
+
658
+ <span class='type'>(<tt>HashWithIndifferentAccess</tt>)</span>
659
+
660
+
661
+
662
+ &mdash;
663
+ <div class='inline'><p>The links for the current response.</p>
664
+ </div>
665
+
666
+ </li>
667
+
668
+ </ul>
669
+
670
+ </div><table class="source_code">
671
+ <tr>
672
+ <td>
673
+ <pre class="lines">
674
+
675
+
676
+ 37
677
+ 38
678
+ 39</pre>
679
+ </td>
680
+ <td>
681
+ <pre class="code"><span class="info file"># File 'lib/ballast/concerns/json_api/response_handling.rb', line 37</span>
682
+
683
+ <span class='kw'>def</span> <span class='id identifier rubyid_response_links'>response_links</span><span class='lparen'>(</span><span class='id identifier rubyid_default'>default</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='rparen'>)</span>
684
+ <span class='ivar'>@links</span> <span class='op'>||</span> <span class='id identifier rubyid_default'>default</span> <span class='op'>||</span> <span class='const'>HashWithIndifferentAccess</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
685
+ <span class='kw'>end</span></pre>
686
+ </td>
687
+ </tr>
688
+ </table>
689
+ </div>
690
+
691
+ <div class="method_details ">
692
+ <h3 class="signature " id="response_meta-instance_method">
693
+
694
+ - (<tt>HashWithIndifferentAccess</tt>) <strong>response_meta</strong>(default = nil)
695
+
696
+
697
+
698
+
699
+
700
+ </h3><div class="docstring">
701
+ <div class="discussion">
702
+ <p>Returns the metadata for the current response.</p>
703
+
704
+
705
+ </div>
706
+ </div>
707
+ <div class="tags">
708
+ <p class="tag_title">Parameters:</p>
709
+ <ul class="param">
710
+
711
+ <li>
712
+
713
+ <span class='name'>default</span>
714
+
715
+
716
+ <span class='type'>(<tt>Object|NilClass</tt>)</span>
717
+
718
+
719
+ <em class="default">(defaults to: <tt>nil</tt>)</em>
720
+
721
+
722
+ &mdash;
723
+ <div class='inline'><p>The default metadata to return if nothing is set.</p>
724
+ </div>
725
+
726
+ </li>
727
+
728
+ </ul>
729
+
730
+ <p class="tag_title">Returns:</p>
731
+ <ul class="return">
732
+
733
+ <li>
734
+
735
+
736
+ <span class='type'>(<tt>HashWithIndifferentAccess</tt>)</span>
737
+
738
+
739
+
740
+ &mdash;
741
+ <div class='inline'><p>The metadata for the current response.</p>
742
+ </div>
743
+
744
+ </li>
745
+
746
+ </ul>
747
+
748
+ </div><table class="source_code">
749
+ <tr>
750
+ <td>
751
+ <pre class="lines">
752
+
753
+
754
+ 21
755
+ 22
756
+ 23</pre>
757
+ </td>
758
+ <td>
759
+ <pre class="code"><span class="info file"># File 'lib/ballast/concerns/json_api/response_handling.rb', line 21</span>
760
+
761
+ <span class='kw'>def</span> <span class='id identifier rubyid_response_meta'>response_meta</span><span class='lparen'>(</span><span class='id identifier rubyid_default'>default</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='rparen'>)</span>
762
+ <span class='ivar'>@meta</span> <span class='op'>||</span> <span class='id identifier rubyid_default'>default</span> <span class='op'>||</span> <span class='const'>HashWithIndifferentAccess</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
763
+ <span class='kw'>end</span></pre>
764
+ </td>
765
+ </tr>
766
+ </table>
767
+ </div>
768
+
769
+ <div class="method_details ">
770
+ <h3 class="signature " id="response_template_for-instance_method">
771
+
772
+ - (<tt>String</tt>) <strong>response_template_for</strong>(object)
773
+
774
+
775
+
776
+
777
+
778
+ </h3><div class="docstring">
779
+ <div class="discussion">
780
+ <p>Returns the template for a object. It can overriden by setting the <code>@object_template</code> variable.</p>
781
+
782
+
783
+ </div>
784
+ </div>
785
+ <div class="tags">
786
+
787
+ <p class="tag_title">Returns:</p>
788
+ <ul class="return">
789
+
790
+ <li>
791
+
792
+
793
+ <span class='type'>(<tt>String</tt>)</span>
794
+
795
+
796
+
797
+ &mdash;
798
+ <div class='inline'><p>The template for a object.</p>
799
+ </div>
800
+
801
+ </li>
802
+
803
+ </ul>
804
+
805
+ </div><table class="source_code">
806
+ <tr>
807
+ <td>
808
+ <pre class="lines">
809
+
810
+
811
+ 11
812
+ 12
813
+ 13
814
+ 14
815
+ 15</pre>
816
+ </td>
817
+ <td>
818
+ <pre class="code"><span class="info file"># File 'lib/ballast/concerns/json_api/response_handling.rb', line 11</span>
819
+
820
+ <span class='kw'>def</span> <span class='id identifier rubyid_response_template_for'>response_template_for</span><span class='lparen'>(</span><span class='id identifier rubyid_object'>object</span><span class='rparen'>)</span>
821
+ <span class='kw'>return</span> <span class='ivar'>@object_template</span> <span class='kw'>if</span> <span class='ivar'>@object_template</span>
822
+ <span class='id identifier rubyid_object'>object</span> <span class='op'>=</span> <span class='id identifier rubyid_object'>object</span><span class='period'>.</span><span class='id identifier rubyid_first'>first</span> <span class='kw'>if</span> <span class='id identifier rubyid_object'>object</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>
823
+ <span class='id identifier rubyid_object'>object</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span><span class='period'>.</span><span class='id identifier rubyid_name'>name</span><span class='period'>.</span><span class='id identifier rubyid_underscore'>underscore</span><span class='period'>.</span><span class='id identifier rubyid_gsub'>gsub</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>/</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>_</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span>
824
+ <span class='kw'>end</span></pre>
825
+ </td>
826
+ </tr>
827
+ </table>
828
+ </div>
829
+
830
+ <div class="method_details ">
831
+ <h3 class="signature " id="response_timestamp-instance_method">
832
+
833
+ - (<tt>String</tt>) <strong>response_timestamp</strong>(timestamp)
834
+
835
+
836
+
837
+
838
+
839
+ </h3><div class="docstring">
840
+ <div class="discussion">
841
+ <p>Formats a timestamp in ISO 8601 format.</p>
842
+
843
+
844
+ </div>
845
+ </div>
846
+ <div class="tags">
847
+ <p class="tag_title">Parameters:</p>
848
+ <ul class="param">
849
+
850
+ <li>
851
+
852
+ <span class='name'>timestamp</span>
853
+
854
+
855
+ <span class='type'>(<tt>DateTime|Time|Date</tt>)</span>
856
+
857
+
858
+
859
+ &mdash;
860
+ <div class='inline'><p>The timestamp to format.</p>
861
+ </div>
862
+
863
+ </li>
864
+
865
+ </ul>
866
+
867
+ <p class="tag_title">Returns:</p>
868
+ <ul class="return">
869
+
870
+ <li>
871
+
872
+
873
+ <span class='type'>(<tt>String</tt>)</span>
874
+
875
+
876
+
877
+ &mdash;
878
+ <div class='inline'><p>The timestamp in ISO 8601 format.</p>
879
+ </div>
880
+
881
+ </li>
882
+
883
+ </ul>
884
+
885
+ </div><table class="source_code">
886
+ <tr>
887
+ <td>
888
+ <pre class="lines">
889
+
890
+
891
+ 64
892
+ 65
893
+ 66</pre>
894
+ </td>
895
+ <td>
896
+ <pre class="code"><span class="info file"># File 'lib/ballast/concerns/json_api/response_handling.rb', line 64</span>
897
+
898
+ <span class='kw'>def</span> <span class='id identifier rubyid_response_timestamp'>response_timestamp</span><span class='lparen'>(</span><span class='id identifier rubyid_timestamp'>timestamp</span><span class='rparen'>)</span>
899
+ <span class='id identifier rubyid_timestamp'>timestamp</span><span class='period'>.</span><span class='id identifier rubyid_safe_send'>safe_send</span><span class='lparen'>(</span><span class='symbol'>:strftime</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>%FT%T.%L%z</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span>
900
+ <span class='kw'>end</span></pre>
901
+ </td>
902
+ </tr>
903
+ </table>
904
+ </div>
905
+
906
+ </div>
907
+
908
+ </div>
909
+
910
+ <div id="footer">
911
+ Generated on Thu Aug 18 15:49:49 2016 by
912
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
913
+ 0.8.7.6 (ruby-2.3.0).
914
+ </div>
915
+
916
+ </body>
917
+ </html>