prismic.io 1.4.1 → 1.4.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/.yardopts +1 -1
  3. data/Gemfile.lock +1 -1
  4. data/README.md +6 -14
  5. data/docs/Prismic.html +1074 -0
  6. data/docs/Prismic/API.html +2987 -0
  7. data/docs/Prismic/API/BadPrismicResponseError.html +147 -0
  8. data/docs/Prismic/API/OAuth.html +560 -0
  9. data/docs/Prismic/API/PrismicWSAuthError.html +375 -0
  10. data/docs/Prismic/API/PrismicWSConnectionError.html +221 -0
  11. data/docs/Prismic/BasicNullCache.html +255 -0
  12. data/docs/Prismic/DefaultHTTPClient.html +350 -0
  13. data/docs/Prismic/Document.html +873 -0
  14. data/docs/Prismic/Error.html +418 -0
  15. data/docs/Prismic/Experiment.html +633 -0
  16. data/docs/Prismic/Experiments.html +633 -0
  17. data/docs/Prismic/Field.html +424 -0
  18. data/docs/Prismic/Form.html +827 -0
  19. data/docs/Prismic/Fragments.html +117 -0
  20. data/docs/Prismic/Fragments/Color.html +632 -0
  21. data/docs/Prismic/Fragments/Date.html +399 -0
  22. data/docs/Prismic/Fragments/DocumentLink.html +1048 -0
  23. data/docs/Prismic/Fragments/Embed.html +679 -0
  24. data/docs/Prismic/Fragments/FileLink.html +604 -0
  25. data/docs/Prismic/Fragments/Fragment.html +339 -0
  26. data/docs/Prismic/Fragments/GeoPoint.html +469 -0
  27. data/docs/Prismic/Fragments/Group.html +710 -0
  28. data/docs/Prismic/Fragments/GroupDocument.html +382 -0
  29. data/docs/Prismic/Fragments/Image.html +780 -0
  30. data/docs/Prismic/Fragments/Image/View.html +759 -0
  31. data/docs/Prismic/Fragments/Image/ViewDoesNotExistException.html +147 -0
  32. data/docs/Prismic/Fragments/ImageLink.html +336 -0
  33. data/docs/Prismic/Fragments/Link.html +412 -0
  34. data/docs/Prismic/Fragments/Multiple.html +513 -0
  35. data/docs/Prismic/Fragments/Number.html +401 -0
  36. data/docs/Prismic/Fragments/Select.html +349 -0
  37. data/docs/Prismic/Fragments/Separator.html +396 -0
  38. data/docs/Prismic/Fragments/Slice.html +632 -0
  39. data/docs/Prismic/Fragments/SliceZone.html +474 -0
  40. data/docs/Prismic/Fragments/StructuredText.html +664 -0
  41. data/docs/Prismic/Fragments/StructuredText/Block.html +232 -0
  42. data/docs/Prismic/Fragments/StructuredText/Block/Embed.html +367 -0
  43. data/docs/Prismic/Fragments/StructuredText/Block/Heading.html +366 -0
  44. data/docs/Prismic/Fragments/StructuredText/Block/Image.html +755 -0
  45. data/docs/Prismic/Fragments/StructuredText/Block/ListItem.html +372 -0
  46. data/docs/Prismic/Fragments/StructuredText/Block/Paragraph.html +223 -0
  47. data/docs/Prismic/Fragments/StructuredText/Block/Preformatted.html +223 -0
  48. data/docs/Prismic/Fragments/StructuredText/Block/Text.html +818 -0
  49. data/docs/Prismic/Fragments/StructuredText/BlockGroup.html +423 -0
  50. data/docs/Prismic/Fragments/StructuredText/Span.html +384 -0
  51. data/docs/Prismic/Fragments/StructuredText/Span/Em.html +213 -0
  52. data/docs/Prismic/Fragments/StructuredText/Span/Hyperlink.html +359 -0
  53. data/docs/Prismic/Fragments/StructuredText/Span/Label.html +362 -0
  54. data/docs/Prismic/Fragments/StructuredText/Span/Strong.html +213 -0
  55. data/docs/Prismic/Fragments/Text.html +396 -0
  56. data/docs/Prismic/Fragments/Timestamp.html +399 -0
  57. data/docs/Prismic/Fragments/WebLink.html +340 -0
  58. data/docs/Prismic/HtmlSerializer.html +270 -0
  59. data/docs/Prismic/JsonParser.html +1764 -0
  60. data/docs/Prismic/LinkResolver.html +399 -0
  61. data/docs/Prismic/LruCache.html +1140 -0
  62. data/docs/Prismic/Predicates.html +1630 -0
  63. data/docs/Prismic/Ref.html +643 -0
  64. data/docs/Prismic/Response.html +1159 -0
  65. data/docs/Prismic/SearchForm.html +2172 -0
  66. data/docs/Prismic/SearchForm/AuthenticationException.html +147 -0
  67. data/docs/Prismic/SearchForm/AuthorizationException.html +147 -0
  68. data/docs/Prismic/SearchForm/FormSearchException.html +147 -0
  69. data/docs/Prismic/SearchForm/NoRefSetException.html +147 -0
  70. data/docs/Prismic/SearchForm/RefNotFoundException.html +147 -0
  71. data/docs/Prismic/SearchForm/UnsupportedFormKind.html +147 -0
  72. data/docs/Prismic/Variation.html +546 -0
  73. data/docs/Prismic/WithFragments.html +1803 -0
  74. data/docs/_index.html +752 -0
  75. data/docs/class_list.html +54 -0
  76. data/docs/css/common.css +1 -0
  77. data/docs/css/full_list.css +57 -0
  78. data/docs/css/style.css +339 -0
  79. data/docs/file.README.html +180 -0
  80. data/docs/file_list.html +56 -0
  81. data/docs/frames.html +26 -0
  82. data/docs/index.html +180 -0
  83. data/docs/js/app.js +219 -0
  84. data/docs/js/full_list.js +178 -0
  85. data/docs/js/jquery.js +4 -0
  86. data/docs/method_list.html +2381 -0
  87. data/docs/top-level-namespace.html +112 -0
  88. data/lib/prismic.rb +17 -1
  89. data/lib/prismic/api.rb +31 -19
  90. data/lib/prismic/fragments/image.rb +6 -0
  91. data/lib/prismic/json_parsers.rb +2 -0
  92. data/lib/prismic/version.rb +1 -1
  93. data/spec/cache_spec.rb +12 -12
  94. data/spec/json_parsers_spec.rb +10 -5
  95. data/spec/oauth_spec.rb +3 -3
  96. data/spec/prismic_spec.rb +7 -7
  97. data/spec/responses_mocks/api.json +12 -12
  98. data/spec/responses_mocks/document.json +4 -2
  99. data/spec/responses_mocks/document_with_unknown_fragment.json +2 -0
  100. data/spec/responses_mocks/fragments.json +5 -3
  101. data/spec/responses_mocks/slices.json +2 -0
  102. data/spec/responses_mocks/structured_text_with_labels.json +2 -2
  103. data/spec/simple_search_spec.rb +55 -0
  104. metadata +103 -24
  105. data/deploy-doc.sh +0 -9
  106. data/spec/doc_spec.rb +0 -298
  107. data/spec/lesbonneschoses_spec.rb +0 -228
@@ -0,0 +1,2987 @@
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: Prismic::API
8
+
9
+ &mdash; Documentation by YARD 0.8.7.4
10
+
11
+ </title>
12
+
13
+ <link rel="stylesheet" href="../css/style.css" type="text/css" charset="utf-8" />
14
+
15
+ <link rel="stylesheet" href="../css/common.css" type="text/css" charset="utf-8" />
16
+
17
+ <script type="text/javascript" charset="utf-8">
18
+ hasFrames = window.top.frames.main ? true : false;
19
+ relpath = '../';
20
+ framesUrl = "../frames.html#!Prismic/API.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 (A)</a> &raquo;
35
+ <span class='title'><span class='object_link'><a href="../Prismic.html" title="Prismic (module)">Prismic</a></span></span>
36
+ &raquo;
37
+ <span class="title">API</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: Prismic::API
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">Prismic::API</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/prismic/api.rb</dd>
98
+
99
+ </dl>
100
+ <div class="clear"></div>
101
+
102
+ <h2>Overview</h2><div class="docstring">
103
+ <div class="discussion">
104
+ <p>The API is the main class</p>
105
+
106
+
107
+ </div>
108
+ </div>
109
+ <div class="tags">
110
+
111
+
112
+ </div><h2>Defined Under Namespace</h2>
113
+ <p class="children">
114
+
115
+
116
+
117
+
118
+ <strong class="classes">Classes:</strong> <span class='object_link'><a href="API/BadPrismicResponseError.html" title="Prismic::API::BadPrismicResponseError (class)">BadPrismicResponseError</a></span>, <span class='object_link'><a href="API/OAuth.html" title="Prismic::API::OAuth (class)">OAuth</a></span>, <span class='object_link'><a href="API/PrismicWSAuthError.html" title="Prismic::API::PrismicWSAuthError (class)">PrismicWSAuthError</a></span>, <span class='object_link'><a href="API/PrismicWSConnectionError.html" title="Prismic::API::PrismicWSConnectionError (class)">PrismicWSConnectionError</a></span>
119
+
120
+
121
+ </p>
122
+
123
+ <h2>Constant Summary</h2>
124
+
125
+ <dl class="constants">
126
+
127
+ <dt id="warned_create_search_form-classvariable" class="">@@warned_create_search_form =
128
+
129
+ </dt>
130
+ <dd><pre class="code"><span class='kw'>false</span></pre></dd>
131
+
132
+ <dt id="warned_oauth_initiate_url-classvariable" class="">@@warned_oauth_initiate_url =
133
+
134
+ </dt>
135
+ <dd><pre class="code"><span class='kw'>false</span></pre></dd>
136
+
137
+ <dt id="warned_oauth_check_token-classvariable" class="">@@warned_oauth_check_token =
138
+
139
+ </dt>
140
+ <dd><pre class="code"><span class='kw'>false</span></pre></dd>
141
+
142
+ </dl>
143
+
144
+
145
+
146
+
147
+
148
+ <h2>Instance Attribute Summary <small>(<a href="#" class="summary_toggle">collapse</a>)</small></h2>
149
+ <ul class="summary">
150
+
151
+ <li class="public ">
152
+ <span class="summary_signature">
153
+
154
+ <a href="#access_token-instance_method" title="#access_token (instance method)">- (String) <strong>access_token</strong> </a>
155
+
156
+
157
+
158
+ </span>
159
+
160
+
161
+
162
+
163
+ <span class="note title readonly">readonly</span>
164
+
165
+
166
+
167
+
168
+
169
+
170
+
171
+
172
+
173
+ <span class="summary_desc"><div class='inline'></div></span>
174
+
175
+ </li>
176
+
177
+
178
+ <li class="public ">
179
+ <span class="summary_signature">
180
+
181
+ <a href="#bookmarks-instance_method" title="#bookmarks (instance method)">- (Hash{String =&gt; String}) <strong>bookmarks</strong> </a>
182
+
183
+
184
+
185
+ </span>
186
+
187
+
188
+
189
+
190
+
191
+
192
+
193
+
194
+
195
+
196
+
197
+
198
+ <span class="summary_desc"><div class='inline'><p>List of bookmarks, as name -&gt; documentId.</p>
199
+ </div></span>
200
+
201
+ </li>
202
+
203
+
204
+ <li class="public ">
205
+ <span class="summary_signature">
206
+
207
+ <a href="#cache-instance_method" title="#cache (instance method)">- (Object) <strong>cache</strong> </a>
208
+
209
+
210
+
211
+ </span>
212
+
213
+
214
+
215
+
216
+
217
+
218
+
219
+
220
+
221
+
222
+
223
+
224
+ <span class="summary_desc"><div class='inline'><p>Returns the value of attribute cache.</p>
225
+ </div></span>
226
+
227
+ </li>
228
+
229
+
230
+ <li class="public ">
231
+ <span class="summary_signature">
232
+
233
+ <a href="#experiments-instance_method" title="#experiments (instance method)">- (Experiments) <strong>experiments</strong> </a>
234
+
235
+
236
+
237
+ </span>
238
+
239
+
240
+
241
+
242
+
243
+
244
+
245
+
246
+
247
+
248
+
249
+
250
+ <span class="summary_desc"><div class='inline'><p>List of all experiments from Prismic.</p>
251
+ </div></span>
252
+
253
+ </li>
254
+
255
+
256
+ <li class="public ">
257
+ <span class="summary_signature">
258
+
259
+ <a href="#forms-instance_method" title="#forms (instance method)">- (Hash{String =&gt; Form}) <strong>forms</strong> </a>
260
+
261
+
262
+
263
+ </span>
264
+
265
+
266
+
267
+
268
+
269
+
270
+
271
+
272
+
273
+
274
+
275
+
276
+ <span class="summary_desc"><div class='inline'><p>List of forms, as name -&gt; Form.</p>
277
+ </div></span>
278
+
279
+ </li>
280
+
281
+
282
+ <li class="public ">
283
+ <span class="summary_signature">
284
+
285
+ <a href="#http_client-instance_method" title="#http_client (instance method)">- (Object) <strong>http_client</strong> </a>
286
+
287
+
288
+
289
+ </span>
290
+
291
+
292
+
293
+
294
+ <span class="note title readonly">readonly</span>
295
+
296
+
297
+
298
+
299
+
300
+
301
+
302
+
303
+
304
+ <span class="summary_desc"><div class='inline'><p>Returns the value of attribute http_client.</p>
305
+ </div></span>
306
+
307
+ </li>
308
+
309
+
310
+ <li class="public ">
311
+ <span class="summary_signature">
312
+
313
+ <a href="#json-instance_method" title="#json (instance method)">- (Object) <strong>json</strong> </a>
314
+
315
+
316
+
317
+ </span>
318
+
319
+
320
+
321
+
322
+ <span class="note title readonly">readonly</span>
323
+
324
+
325
+
326
+
327
+
328
+
329
+
330
+
331
+
332
+ <span class="summary_desc"><div class='inline'><p>Returns the value of attribute json.</p>
333
+ </div></span>
334
+
335
+ </li>
336
+
337
+
338
+ <li class="public ">
339
+ <span class="summary_signature">
340
+
341
+ <a href="#master-instance_method" title="#master (instance method)">- (Ref) <strong>master</strong> </a>
342
+
343
+
344
+
345
+ (also: #master_ref)
346
+
347
+ </span>
348
+
349
+
350
+
351
+
352
+
353
+
354
+
355
+
356
+
357
+
358
+
359
+
360
+ <span class="summary_desc"><div class='inline'><p>Returns the master <span class='object_link'><a href="Ref.html" title="Prismic::Ref (class)">reference</a></span>.</p>
361
+ </div></span>
362
+
363
+ </li>
364
+
365
+
366
+ <li class="public ">
367
+ <span class="summary_signature">
368
+
369
+ <a href="#oauth-instance_method" title="#oauth (instance method)">- (Object) <strong>oauth</strong> </a>
370
+
371
+
372
+
373
+ </span>
374
+
375
+
376
+
377
+
378
+
379
+
380
+
381
+
382
+
383
+
384
+
385
+
386
+ <span class="summary_desc"><div class='inline'><p>Returns the value of attribute oauth.</p>
387
+ </div></span>
388
+
389
+ </li>
390
+
391
+
392
+ <li class="public ">
393
+ <span class="summary_signature">
394
+
395
+ <a href="#refs-instance_method" title="#refs (instance method)">- (Hash{String =&gt; Ref}) <strong>refs</strong> </a>
396
+
397
+
398
+
399
+ </span>
400
+
401
+
402
+
403
+
404
+
405
+
406
+
407
+
408
+
409
+
410
+
411
+
412
+ <span class="summary_desc"><div class='inline'><p>List of references, as label -&gt; reference.</p>
413
+ </div></span>
414
+
415
+ </li>
416
+
417
+
418
+ <li class="public ">
419
+ <span class="summary_signature">
420
+
421
+ <a href="#tags-instance_method" title="#tags (instance method)">- (Object) <strong>tags</strong> </a>
422
+
423
+
424
+
425
+ </span>
426
+
427
+
428
+
429
+
430
+
431
+
432
+
433
+
434
+
435
+
436
+
437
+
438
+ <span class="summary_desc"><div class='inline'><p>Returns the value of attribute tags.</p>
439
+ </div></span>
440
+
441
+ </li>
442
+
443
+
444
+ <li class="public ">
445
+ <span class="summary_signature">
446
+
447
+ <a href="#types-instance_method" title="#types (instance method)">- (Object) <strong>types</strong> </a>
448
+
449
+
450
+
451
+ </span>
452
+
453
+
454
+
455
+
456
+
457
+
458
+
459
+
460
+
461
+
462
+
463
+
464
+ <span class="summary_desc"><div class='inline'><p>Returns the value of attribute types.</p>
465
+ </div></span>
466
+
467
+ </li>
468
+
469
+
470
+ </ul>
471
+
472
+
473
+
474
+
475
+
476
+ <h2>
477
+ Class Method Summary
478
+ <small>(<a href="#" class="summary_toggle">collapse</a>)</small>
479
+ </h2>
480
+
481
+ <ul class="summary">
482
+
483
+ <li class="public ">
484
+ <span class="summary_signature">
485
+
486
+ <a href="#get-class_method" title="get (class method)">+ (Object) <strong>get</strong>(url, access_token = nil, http_client = Prismic::DefaultHTTPClient, api_cache = Prismic::DefaultCache) </a>
487
+
488
+
489
+
490
+ </span>
491
+
492
+
493
+
494
+
495
+
496
+
497
+
498
+
499
+
500
+ <span class="summary_desc"><div class='inline'><p>Fetch the API information from the Prismic.io server.</p>
501
+ </div></span>
502
+
503
+ </li>
504
+
505
+
506
+ <li class="public ">
507
+ <span class="summary_signature">
508
+
509
+ <a href="#oauth_check_token-class_method" title="oauth_check_token (class method)">+ (Object) <strong>oauth_check_token</strong>(url, oauth_params, api_opts = {}) </a>
510
+
511
+
512
+
513
+ </span>
514
+
515
+
516
+
517
+
518
+
519
+
520
+
521
+
522
+
523
+ <span class="summary_desc"><div class='inline'></div></span>
524
+
525
+ </li>
526
+
527
+
528
+ <li class="public ">
529
+ <span class="summary_signature">
530
+
531
+ <a href="#oauth_initiate_url-class_method" title="oauth_initiate_url (class method)">+ (Object) <strong>oauth_initiate_url</strong>(url, oauth_opts, api_opts = {}) </a>
532
+
533
+
534
+
535
+ </span>
536
+
537
+
538
+
539
+
540
+
541
+
542
+
543
+
544
+
545
+ <span class="summary_desc"><div class='inline'></div></span>
546
+
547
+ </li>
548
+
549
+
550
+ <li class="public ">
551
+ <span class="summary_signature">
552
+
553
+ <a href="#parse_api_response-class_method" title="parse_api_response (class method)">+ (Object) <strong>parse_api_response</strong>(data, access_token, http_client, cache) </a>
554
+
555
+
556
+
557
+ </span>
558
+
559
+
560
+
561
+
562
+
563
+
564
+
565
+
566
+
567
+ <span class="summary_desc"><div class='inline'></div></span>
568
+
569
+ </li>
570
+
571
+
572
+ <li class="public ">
573
+ <span class="summary_signature">
574
+
575
+ <a href="#start-class_method" title="start (class method)">+ (Object) <strong>start</strong>(url, opts = {}) </a>
576
+
577
+
578
+
579
+ </span>
580
+
581
+
582
+
583
+
584
+
585
+
586
+
587
+
588
+
589
+ <span class="summary_desc"><div class='inline'></div></span>
590
+
591
+ </li>
592
+
593
+
594
+ </ul>
595
+
596
+ <h2>
597
+ Instance Method Summary
598
+ <small>(<a href="#" class="summary_toggle">collapse</a>)</small>
599
+ </h2>
600
+
601
+ <ul class="summary">
602
+
603
+ <li class="public ">
604
+ <span class="summary_signature">
605
+
606
+ <a href="#all-instance_method" title="#all (instance method)">- (Object) <strong>all</strong>(data = {}) </a>
607
+
608
+
609
+
610
+ </span>
611
+
612
+
613
+
614
+
615
+
616
+
617
+
618
+
619
+
620
+ <span class="summary_desc"><div class='inline'><p>Retrieve all documents (paginated).</p>
621
+ </div></span>
622
+
623
+ </li>
624
+
625
+
626
+ <li class="public ">
627
+ <span class="summary_signature">
628
+
629
+ <a href="#as_json-instance_method" title="#as_json (instance method)">- (Object) <strong>as_json</strong> </a>
630
+
631
+
632
+
633
+ </span>
634
+
635
+
636
+
637
+
638
+
639
+
640
+
641
+
642
+
643
+ <span class="summary_desc"><div class='inline'></div></span>
644
+
645
+ </li>
646
+
647
+
648
+ <li class="public ">
649
+ <span class="summary_signature">
650
+
651
+ <a href="#bookmark-instance_method" title="#bookmark (instance method)">- (String) <strong>bookmark</strong>(name) </a>
652
+
653
+
654
+
655
+ </span>
656
+
657
+
658
+
659
+
660
+
661
+
662
+
663
+
664
+
665
+ <span class="summary_desc"><div class='inline'><p>Get a bookmark by its name.</p>
666
+ </div></span>
667
+
668
+ </li>
669
+
670
+
671
+ <li class="public deprecated">
672
+ <span class="summary_signature">
673
+
674
+ <a href="#create_search_form-instance_method" title="#create_search_form (instance method)">- (Object) <strong>create_search_form</strong>(name, data = {}, ref = {}) </a>
675
+
676
+
677
+
678
+ </span>
679
+
680
+
681
+
682
+
683
+
684
+ <span class="deprecated note title">deprecated</span>
685
+
686
+
687
+
688
+ <span class="summary_desc"><strong>Deprecated.</strong> <div class='inline'><p>Use <span class='object_link'><a href="#form-instance_method" title="Prismic::API#form (method)">#form</a></span> instead.</p>
689
+ </div></span>
690
+
691
+ </li>
692
+
693
+
694
+ <li class="public ">
695
+ <span class="summary_signature">
696
+
697
+ <a href="#form-instance_method" title="#form (instance method)">- (SearchForm) <strong>form</strong>(name, data = {}, ref = {}) </a>
698
+
699
+
700
+
701
+ </span>
702
+
703
+
704
+
705
+
706
+
707
+
708
+
709
+
710
+
711
+ <span class="summary_desc"><div class='inline'><p>Returns a <span class='object_link'><a href="SearchForm.html" title="Prismic::SearchForm (class)">search form</a></span> by its name.</p>
712
+ </div></span>
713
+
714
+ </li>
715
+
716
+
717
+ <li class="public ">
718
+ <span class="summary_signature">
719
+
720
+ <a href="#getByID-instance_method" title="#getByID (instance method)">- (Object) <strong>getByID</strong>(id, data = {}) </a>
721
+
722
+
723
+
724
+ </span>
725
+
726
+
727
+
728
+
729
+
730
+
731
+
732
+
733
+
734
+ <span class="summary_desc"><div class='inline'><p>Retrieve one document by its id.</p>
735
+ </div></span>
736
+
737
+ </li>
738
+
739
+
740
+ <li class="public ">
741
+ <span class="summary_signature">
742
+
743
+ <a href="#getByIDs-instance_method" title="#getByIDs (instance method)">- (Object) <strong>getByIDs</strong>(ids, data = {}) </a>
744
+
745
+
746
+
747
+ </span>
748
+
749
+
750
+
751
+
752
+
753
+
754
+
755
+
756
+
757
+ <span class="summary_desc"><div class='inline'><p>Retrieve multiple documents by their ids.</p>
758
+ </div></span>
759
+
760
+ </li>
761
+
762
+
763
+ <li class="public ">
764
+ <span class="summary_signature">
765
+
766
+ <a href="#getByUID-instance_method" title="#getByUID (instance method)">- (Object) <strong>getByUID</strong>(typ, uid, data = {}) </a>
767
+
768
+
769
+
770
+ </span>
771
+
772
+
773
+
774
+
775
+
776
+
777
+
778
+
779
+
780
+ <span class="summary_desc"><div class='inline'><p>Retrieve one document by its uid.</p>
781
+ </div></span>
782
+
783
+ </li>
784
+
785
+
786
+ <li class="public ">
787
+ <span class="summary_signature">
788
+
789
+ <a href="#has_cache%3F-instance_method" title="#has_cache? (instance method)">- (Boolean) <strong>has_cache?</strong> </a>
790
+
791
+
792
+
793
+ </span>
794
+
795
+
796
+
797
+
798
+
799
+
800
+
801
+
802
+
803
+ <span class="summary_desc"><div class='inline'><p>Is the cache enabled on this API object?.</p>
804
+ </div></span>
805
+
806
+ </li>
807
+
808
+
809
+ <li class="public ">
810
+ <span class="summary_signature">
811
+
812
+ <a href="#initialize-instance_method" title="#initialize (instance method)">- (API) <strong>initialize</strong>(json, access_token, http_client, cache) {|_self| ... }</a>
813
+
814
+
815
+
816
+ </span>
817
+
818
+
819
+ <span class="note title constructor">constructor</span>
820
+
821
+
822
+
823
+
824
+
825
+
826
+
827
+
828
+ <span class="summary_desc"><div class='inline'><p>A new instance of API.</p>
829
+ </div></span>
830
+
831
+ </li>
832
+
833
+
834
+ <li class="public ">
835
+ <span class="summary_signature">
836
+
837
+ <a href="#oauth_check_token-instance_method" title="#oauth_check_token (instance method)">- (Object) <strong>oauth_check_token</strong>(params) </a>
838
+
839
+
840
+
841
+ </span>
842
+
843
+
844
+
845
+
846
+
847
+
848
+
849
+
850
+
851
+ <span class="summary_desc"><div class='inline'></div></span>
852
+
853
+ </li>
854
+
855
+
856
+ <li class="public ">
857
+ <span class="summary_signature">
858
+
859
+ <a href="#oauth_initiate_url-instance_method" title="#oauth_initiate_url (instance method)">- (Object) <strong>oauth_initiate_url</strong>(opts) </a>
860
+
861
+
862
+
863
+ </span>
864
+
865
+
866
+
867
+
868
+
869
+
870
+
871
+
872
+
873
+ <span class="summary_desc"><div class='inline'></div></span>
874
+
875
+ </li>
876
+
877
+
878
+ <li class="public ">
879
+ <span class="summary_signature">
880
+
881
+ <a href="#preview_session-instance_method" title="#preview_session (instance method)">- (String) <strong>preview_session</strong>(token, link_resolver, default_url) </a>
882
+
883
+
884
+
885
+ </span>
886
+
887
+
888
+
889
+
890
+
891
+
892
+
893
+
894
+
895
+ <span class="summary_desc"><div class='inline'><p>Return the URL to display a given preview (usually the home page of your site).</p>
896
+ </div></span>
897
+
898
+ </li>
899
+
900
+
901
+ <li class="public ">
902
+ <span class="summary_signature">
903
+
904
+ <a href="#query-instance_method" title="#query (instance method)">- (Object) <strong>query</strong>(q, data = {}) </a>
905
+
906
+
907
+
908
+ </span>
909
+
910
+
911
+
912
+
913
+
914
+
915
+
916
+
917
+
918
+ <span class="summary_desc"><div class='inline'><p>Perform a query on this API.</p>
919
+ </div></span>
920
+
921
+ </li>
922
+
923
+
924
+ <li class="public ">
925
+ <span class="summary_signature">
926
+
927
+ <a href="#ref-instance_method" title="#ref (instance method)">- (Ref) <strong>ref</strong>(name) </a>
928
+
929
+
930
+
931
+ </span>
932
+
933
+
934
+
935
+
936
+
937
+
938
+
939
+
940
+
941
+ <span class="summary_desc"><div class='inline'><p>Get a <span class='object_link'><a href="Ref.html" title="Prismic::Ref (class)">reference</a></span> by its alias.</p>
942
+ </div></span>
943
+
944
+ </li>
945
+
946
+
947
+ </ul>
948
+
949
+
950
+ <div id="constructor_details" class="method_details_list">
951
+ <h2>Constructor Details</h2>
952
+
953
+ <div class="method_details first">
954
+ <h3 class="signature first" id="initialize-instance_method">
955
+
956
+ - (<tt><span class='object_link'><a href="" title="Prismic::API (class)">API</a></span></tt>) <strong>initialize</strong>(json, access_token, http_client, cache) {|_self| ... }
957
+
958
+
959
+
960
+
961
+
962
+ </h3><div class="docstring">
963
+ <div class="discussion">
964
+ <p>Returns a new instance of API</p>
965
+
966
+
967
+ </div>
968
+ </div>
969
+ <div class="tags">
970
+
971
+ <p class="tag_title">Yields:</p>
972
+ <ul class="yield">
973
+
974
+ <li>
975
+
976
+
977
+ <span class='type'>(<tt>_self</tt>)</span>
978
+
979
+
980
+
981
+ </li>
982
+
983
+ </ul>
984
+ <p class="tag_title">Yield Parameters:</p>
985
+ <ul class="yieldparam">
986
+
987
+ <li>
988
+
989
+ <span class='name'>_self</span>
990
+
991
+
992
+ <span class='type'>(<tt><span class='object_link'><a href="" title="Prismic::API (class)">Prismic::API</a></span></tt>)</span>
993
+
994
+
995
+
996
+ &mdash;
997
+ <div class='inline'><p>the object that the method was called on</p>
998
+ </div>
999
+
1000
+ </li>
1001
+
1002
+ </ul>
1003
+ <p class="tag_title">Raises:</p>
1004
+ <ul class="raise">
1005
+
1006
+ <li>
1007
+
1008
+
1009
+ <span class='type'>(<tt><span class='object_link'><a href="API/BadPrismicResponseError.html" title="Prismic::API::BadPrismicResponseError (class)">BadPrismicResponseError</a></span></tt>)</span>
1010
+
1011
+
1012
+
1013
+ </li>
1014
+
1015
+ </ul>
1016
+
1017
+ </div><table class="source_code">
1018
+ <tr>
1019
+ <td>
1020
+ <pre class="lines">
1021
+
1022
+
1023
+ 37
1024
+ 38
1025
+ 39
1026
+ 40
1027
+ 41
1028
+ 42
1029
+ 43
1030
+ 44
1031
+ 45</pre>
1032
+ </td>
1033
+ <td>
1034
+ <pre class="code"><span class="info file"># File 'lib/prismic/api.rb', line 37</span>
1035
+
1036
+ <span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_json'>json</span><span class='comma'>,</span> <span class='id identifier rubyid_access_token'>access_token</span><span class='comma'>,</span> <span class='id identifier rubyid_http_client'>http_client</span><span class='comma'>,</span> <span class='id identifier rubyid_cache'>cache</span><span class='rparen'>)</span>
1037
+ <span class='ivar'>@json</span> <span class='op'>=</span> <span class='id identifier rubyid_json'>json</span>
1038
+ <span class='ivar'>@access_token</span> <span class='op'>=</span> <span class='id identifier rubyid_access_token'>access_token</span>
1039
+ <span class='ivar'>@http_client</span> <span class='op'>=</span> <span class='id identifier rubyid_http_client'>http_client</span>
1040
+ <span class='kw'>yield</span> <span class='kw'>self</span> <span class='kw'>if</span> <span class='id identifier rubyid_block_given?'>block_given?</span>
1041
+ <span class='ivar'>@cache</span> <span class='op'>=</span> <span class='id identifier rubyid_cache'>cache</span>
1042
+ <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_master'>master</span> <span class='op'>=</span> <span class='id identifier rubyid_refs'>refs</span><span class='period'>.</span><span class='id identifier rubyid_values'>values</span> <span class='op'>&amp;&amp;</span> <span class='id identifier rubyid_refs'>refs</span><span class='period'>.</span><span class='id identifier rubyid_values'>values</span><span class='period'>.</span><span class='id identifier rubyid_map'>map</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_ref'>ref</span><span class='op'>|</span> <span class='id identifier rubyid_ref'>ref</span> <span class='kw'>if</span> <span class='id identifier rubyid_ref'>ref</span><span class='period'>.</span><span class='id identifier rubyid_master?'>master?</span> <span class='rbrace'>}</span><span class='period'>.</span><span class='id identifier rubyid_compact'>compact</span><span class='period'>.</span><span class='id identifier rubyid_first'>first</span>
1043
+ <span class='id identifier rubyid_raise'>raise</span> <span class='const'>BadPrismicResponseError</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>No master Ref found</span><span class='tstring_end'>&#39;</span></span> <span class='kw'>unless</span> <span class='id identifier rubyid_master'>master</span>
1044
+ <span class='kw'>end</span></pre>
1045
+ </td>
1046
+ </tr>
1047
+ </table>
1048
+ </div>
1049
+
1050
+ </div>
1051
+
1052
+ <div id="instance_attr_details" class="attr_details">
1053
+ <h2>Instance Attribute Details</h2>
1054
+
1055
+
1056
+ <span id=""></span>
1057
+ <div class="method_details first">
1058
+ <h3 class="signature first" id="access_token-instance_method">
1059
+
1060
+ - (<tt>String</tt>) <strong>access_token</strong> <span class="extras">(readonly)</span>
1061
+
1062
+
1063
+
1064
+
1065
+
1066
+ </h3><div class="docstring">
1067
+ <div class="discussion">
1068
+
1069
+
1070
+ </div>
1071
+ </div>
1072
+ <div class="tags">
1073
+
1074
+ <p class="tag_title">Returns:</p>
1075
+ <ul class="return">
1076
+
1077
+ <li>
1078
+
1079
+
1080
+ <span class='type'>(<tt>String</tt>)</span>
1081
+
1082
+
1083
+
1084
+ </li>
1085
+
1086
+ </ul>
1087
+
1088
+ </div><table class="source_code">
1089
+ <tr>
1090
+ <td>
1091
+ <pre class="lines">
1092
+
1093
+
1094
+ 11
1095
+ 12
1096
+ 13</pre>
1097
+ </td>
1098
+ <td>
1099
+ <pre class="code"><span class="info file"># File 'lib/prismic/api.rb', line 11</span>
1100
+
1101
+ <span class='kw'>def</span> <span class='id identifier rubyid_access_token'>access_token</span>
1102
+ <span class='ivar'>@access_token</span>
1103
+ <span class='kw'>end</span></pre>
1104
+ </td>
1105
+ </tr>
1106
+ </table>
1107
+ </div>
1108
+
1109
+
1110
+ <span id="bookmarks=-instance_method"></span>
1111
+ <div class="method_details ">
1112
+ <h3 class="signature " id="bookmarks-instance_method">
1113
+
1114
+ - (<tt>Hash{String =&gt; String}</tt>) <strong>bookmarks</strong>
1115
+
1116
+
1117
+
1118
+
1119
+
1120
+ </h3><div class="docstring">
1121
+ <div class="discussion">
1122
+ <p>Returns list of bookmarks, as name -&gt; documentId</p>
1123
+
1124
+
1125
+ </div>
1126
+ </div>
1127
+ <div class="tags">
1128
+
1129
+ <p class="tag_title">Returns:</p>
1130
+ <ul class="return">
1131
+
1132
+ <li>
1133
+
1134
+
1135
+ <span class='type'>(<tt>Hash{String =&gt; String}</tt>)</span>
1136
+
1137
+
1138
+
1139
+ &mdash;
1140
+ <div class='inline'><p>list of bookmarks, as name -&gt; documentId</p>
1141
+ </div>
1142
+
1143
+ </li>
1144
+
1145
+ </ul>
1146
+
1147
+ </div><table class="source_code">
1148
+ <tr>
1149
+ <td>
1150
+ <pre class="lines">
1151
+
1152
+
1153
+ 16
1154
+ 17
1155
+ 18</pre>
1156
+ </td>
1157
+ <td>
1158
+ <pre class="code"><span class="info file"># File 'lib/prismic/api.rb', line 16</span>
1159
+
1160
+ <span class='kw'>def</span> <span class='id identifier rubyid_bookmarks'>bookmarks</span>
1161
+ <span class='ivar'>@bookmarks</span>
1162
+ <span class='kw'>end</span></pre>
1163
+ </td>
1164
+ </tr>
1165
+ </table>
1166
+ </div>
1167
+
1168
+
1169
+ <span id="cache=-instance_method"></span>
1170
+ <div class="method_details ">
1171
+ <h3 class="signature " id="cache-instance_method">
1172
+
1173
+ - (<tt>Object</tt>) <strong>cache</strong>
1174
+
1175
+
1176
+
1177
+
1178
+
1179
+ </h3><div class="docstring">
1180
+ <div class="discussion">
1181
+ <p>Returns the value of attribute cache</p>
1182
+
1183
+
1184
+ </div>
1185
+ </div>
1186
+ <div class="tags">
1187
+
1188
+
1189
+ </div><table class="source_code">
1190
+ <tr>
1191
+ <td>
1192
+ <pre class="lines">
1193
+
1194
+
1195
+ 19
1196
+ 20
1197
+ 21</pre>
1198
+ </td>
1199
+ <td>
1200
+ <pre class="code"><span class="info file"># File 'lib/prismic/api.rb', line 19</span>
1201
+
1202
+ <span class='kw'>def</span> <span class='id identifier rubyid_cache'>cache</span>
1203
+ <span class='ivar'>@cache</span>
1204
+ <span class='kw'>end</span></pre>
1205
+ </td>
1206
+ </tr>
1207
+ </table>
1208
+ </div>
1209
+
1210
+
1211
+ <span id="experiments=-instance_method"></span>
1212
+ <div class="method_details ">
1213
+ <h3 class="signature " id="experiments-instance_method">
1214
+
1215
+ - (<tt><span class='object_link'><a href="Experiments.html" title="Prismic::Experiments (class)">Experiments</a></span></tt>) <strong>experiments</strong>
1216
+
1217
+
1218
+
1219
+
1220
+
1221
+ </h3><div class="docstring">
1222
+ <div class="discussion">
1223
+ <p>Returns list of all experiments from Prismic</p>
1224
+
1225
+
1226
+ </div>
1227
+ </div>
1228
+ <div class="tags">
1229
+
1230
+ <p class="tag_title">Returns:</p>
1231
+ <ul class="return">
1232
+
1233
+ <li>
1234
+
1235
+
1236
+ <span class='type'>(<tt><span class='object_link'><a href="Experiments.html" title="Prismic::Experiments (class)">Experiments</a></span></tt>)</span>
1237
+
1238
+
1239
+
1240
+ &mdash;
1241
+ <div class='inline'><p>list of all experiments from Prismic</p>
1242
+ </div>
1243
+
1244
+ </li>
1245
+
1246
+ </ul>
1247
+
1248
+ </div><table class="source_code">
1249
+ <tr>
1250
+ <td>
1251
+ <pre class="lines">
1252
+
1253
+
1254
+ 21
1255
+ 22
1256
+ 23</pre>
1257
+ </td>
1258
+ <td>
1259
+ <pre class="code"><span class="info file"># File 'lib/prismic/api.rb', line 21</span>
1260
+
1261
+ <span class='kw'>def</span> <span class='id identifier rubyid_experiments'>experiments</span>
1262
+ <span class='ivar'>@experiments</span>
1263
+ <span class='kw'>end</span></pre>
1264
+ </td>
1265
+ </tr>
1266
+ </table>
1267
+ </div>
1268
+
1269
+
1270
+ <span id="forms=-instance_method"></span>
1271
+ <div class="method_details ">
1272
+ <h3 class="signature " id="forms-instance_method">
1273
+
1274
+ - (<tt>Hash{String =&gt; <span class='object_link'><a href="Form.html" title="Prismic::Form (class)">Form</a></span>}</tt>) <strong>forms</strong>
1275
+
1276
+
1277
+
1278
+
1279
+
1280
+ </h3><div class="docstring">
1281
+ <div class="discussion">
1282
+ <p>Returns list of forms, as name -&gt; Form</p>
1283
+
1284
+
1285
+ </div>
1286
+ </div>
1287
+ <div class="tags">
1288
+
1289
+ <p class="tag_title">Returns:</p>
1290
+ <ul class="return">
1291
+
1292
+ <li>
1293
+
1294
+
1295
+ <span class='type'>(<tt>Hash{String =&gt; <span class='object_link'><a href="Form.html" title="Prismic::Form (class)">Form</a></span>}</tt>)</span>
1296
+
1297
+
1298
+
1299
+ &mdash;
1300
+ <div class='inline'><p>list of forms, as name -&gt; Form</p>
1301
+ </div>
1302
+
1303
+ </li>
1304
+
1305
+ </ul>
1306
+
1307
+ </div><table class="source_code">
1308
+ <tr>
1309
+ <td>
1310
+ <pre class="lines">
1311
+
1312
+
1313
+ 18
1314
+ 19
1315
+ 20</pre>
1316
+ </td>
1317
+ <td>
1318
+ <pre class="code"><span class="info file"># File 'lib/prismic/api.rb', line 18</span>
1319
+
1320
+ <span class='kw'>def</span> <span class='id identifier rubyid_forms'>forms</span>
1321
+ <span class='ivar'>@forms</span>
1322
+ <span class='kw'>end</span></pre>
1323
+ </td>
1324
+ </tr>
1325
+ </table>
1326
+ </div>
1327
+
1328
+
1329
+ <span id=""></span>
1330
+ <div class="method_details ">
1331
+ <h3 class="signature " id="http_client-instance_method">
1332
+
1333
+ - (<tt>Object</tt>) <strong>http_client</strong> <span class="extras">(readonly)</span>
1334
+
1335
+
1336
+
1337
+
1338
+
1339
+ </h3><div class="docstring">
1340
+ <div class="discussion">
1341
+ <p>Returns the value of attribute http_client</p>
1342
+
1343
+
1344
+ </div>
1345
+ </div>
1346
+ <div class="tags">
1347
+
1348
+
1349
+ </div><table class="source_code">
1350
+ <tr>
1351
+ <td>
1352
+ <pre class="lines">
1353
+
1354
+
1355
+ 12
1356
+ 13
1357
+ 14</pre>
1358
+ </td>
1359
+ <td>
1360
+ <pre class="code"><span class="info file"># File 'lib/prismic/api.rb', line 12</span>
1361
+
1362
+ <span class='kw'>def</span> <span class='id identifier rubyid_http_client'>http_client</span>
1363
+ <span class='ivar'>@http_client</span>
1364
+ <span class='kw'>end</span></pre>
1365
+ </td>
1366
+ </tr>
1367
+ </table>
1368
+ </div>
1369
+
1370
+
1371
+ <span id=""></span>
1372
+ <div class="method_details ">
1373
+ <h3 class="signature " id="json-instance_method">
1374
+
1375
+ - (<tt>Object</tt>) <strong>json</strong> <span class="extras">(readonly)</span>
1376
+
1377
+
1378
+
1379
+
1380
+
1381
+ </h3><div class="docstring">
1382
+ <div class="discussion">
1383
+ <p>Returns the value of attribute json</p>
1384
+
1385
+
1386
+ </div>
1387
+ </div>
1388
+ <div class="tags">
1389
+
1390
+
1391
+ </div><table class="source_code">
1392
+ <tr>
1393
+ <td>
1394
+ <pre class="lines">
1395
+
1396
+
1397
+ 9
1398
+ 10
1399
+ 11</pre>
1400
+ </td>
1401
+ <td>
1402
+ <pre class="code"><span class="info file"># File 'lib/prismic/api.rb', line 9</span>
1403
+
1404
+ <span class='kw'>def</span> <span class='id identifier rubyid_json'>json</span>
1405
+ <span class='ivar'>@json</span>
1406
+ <span class='kw'>end</span></pre>
1407
+ </td>
1408
+ </tr>
1409
+ </table>
1410
+ </div>
1411
+
1412
+
1413
+ <span id="master=-instance_method"></span>
1414
+ <div class="method_details ">
1415
+ <h3 class="signature " id="master-instance_method">
1416
+
1417
+ - (<tt><span class='object_link'><a href="Ref.html" title="Prismic::Ref (class)">Ref</a></span></tt>) <strong>master</strong>
1418
+
1419
+
1420
+
1421
+ <span class="aliases">Also known as:
1422
+ <span class="names"><span id='master_ref-instance_method'>master_ref</span></span>
1423
+ </span>
1424
+
1425
+
1426
+
1427
+ </h3><div class="docstring">
1428
+ <div class="discussion">
1429
+ <p>Returns the master <span class='object_link'><a href="Ref.html" title="Prismic::Ref (class)">reference</a></span></p>
1430
+
1431
+
1432
+ </div>
1433
+ </div>
1434
+ <div class="tags">
1435
+
1436
+ <p class="tag_title">Returns:</p>
1437
+ <ul class="return">
1438
+
1439
+ <li>
1440
+
1441
+
1442
+ <span class='type'>(<tt><span class='object_link'><a href="Ref.html" title="Prismic::Ref (class)">Ref</a></span></tt>)</span>
1443
+
1444
+
1445
+
1446
+ &mdash;
1447
+ <div class='inline'><p>The master <span class='object_link'><a href="Ref.html" title="Prismic::Ref (class)">reference</a></span></p>
1448
+ </div>
1449
+
1450
+ </li>
1451
+
1452
+ </ul>
1453
+
1454
+ </div><table class="source_code">
1455
+ <tr>
1456
+ <td>
1457
+ <pre class="lines">
1458
+
1459
+
1460
+ 34
1461
+ 35
1462
+ 36</pre>
1463
+ </td>
1464
+ <td>
1465
+ <pre class="code"><span class="info file"># File 'lib/prismic/api.rb', line 34</span>
1466
+
1467
+ <span class='kw'>def</span> <span class='id identifier rubyid_master'>master</span>
1468
+ <span class='ivar'>@master</span>
1469
+ <span class='kw'>end</span></pre>
1470
+ </td>
1471
+ </tr>
1472
+ </table>
1473
+ </div>
1474
+
1475
+
1476
+ <span id="oauth=-instance_method"></span>
1477
+ <div class="method_details ">
1478
+ <h3 class="signature " id="oauth-instance_method">
1479
+
1480
+ - (<tt>Object</tt>) <strong>oauth</strong>
1481
+
1482
+
1483
+
1484
+
1485
+
1486
+ </h3><div class="docstring">
1487
+ <div class="discussion">
1488
+ <p>Returns the value of attribute oauth</p>
1489
+
1490
+
1491
+ </div>
1492
+ </div>
1493
+ <div class="tags">
1494
+
1495
+
1496
+ </div><table class="source_code">
1497
+ <tr>
1498
+ <td>
1499
+ <pre class="lines">
1500
+
1501
+
1502
+ 19
1503
+ 20
1504
+ 21</pre>
1505
+ </td>
1506
+ <td>
1507
+ <pre class="code"><span class="info file"># File 'lib/prismic/api.rb', line 19</span>
1508
+
1509
+ <span class='kw'>def</span> <span class='id identifier rubyid_oauth'>oauth</span>
1510
+ <span class='ivar'>@oauth</span>
1511
+ <span class='kw'>end</span></pre>
1512
+ </td>
1513
+ </tr>
1514
+ </table>
1515
+ </div>
1516
+
1517
+
1518
+ <span id="refs=-instance_method"></span>
1519
+ <div class="method_details ">
1520
+ <h3 class="signature " id="refs-instance_method">
1521
+
1522
+ - (<tt>Hash{String =&gt; <span class='object_link'><a href="Ref.html" title="Prismic::Ref (class)">Ref</a></span>}</tt>) <strong>refs</strong>
1523
+
1524
+
1525
+
1526
+
1527
+
1528
+ </h3><div class="docstring">
1529
+ <div class="discussion">
1530
+ <p>Returns list of references, as label -&gt; reference</p>
1531
+
1532
+
1533
+ </div>
1534
+ </div>
1535
+ <div class="tags">
1536
+
1537
+ <p class="tag_title">Returns:</p>
1538
+ <ul class="return">
1539
+
1540
+ <li>
1541
+
1542
+
1543
+ <span class='type'>(<tt>Hash{String =&gt; <span class='object_link'><a href="Ref.html" title="Prismic::Ref (class)">Ref</a></span>}</tt>)</span>
1544
+
1545
+
1546
+
1547
+ &mdash;
1548
+ <div class='inline'><p>list of references, as label -&gt; reference</p>
1549
+ </div>
1550
+
1551
+ </li>
1552
+
1553
+ </ul>
1554
+
1555
+ </div><table class="source_code">
1556
+ <tr>
1557
+ <td>
1558
+ <pre class="lines">
1559
+
1560
+
1561
+ 14
1562
+ 15
1563
+ 16</pre>
1564
+ </td>
1565
+ <td>
1566
+ <pre class="code"><span class="info file"># File 'lib/prismic/api.rb', line 14</span>
1567
+
1568
+ <span class='kw'>def</span> <span class='id identifier rubyid_refs'>refs</span>
1569
+ <span class='ivar'>@refs</span>
1570
+ <span class='kw'>end</span></pre>
1571
+ </td>
1572
+ </tr>
1573
+ </table>
1574
+ </div>
1575
+
1576
+
1577
+ <span id="tags=-instance_method"></span>
1578
+ <div class="method_details ">
1579
+ <h3 class="signature " id="tags-instance_method">
1580
+
1581
+ - (<tt>Object</tt>) <strong>tags</strong>
1582
+
1583
+
1584
+
1585
+
1586
+
1587
+ </h3><div class="docstring">
1588
+ <div class="discussion">
1589
+ <p>Returns the value of attribute tags</p>
1590
+
1591
+
1592
+ </div>
1593
+ </div>
1594
+ <div class="tags">
1595
+
1596
+
1597
+ </div><table class="source_code">
1598
+ <tr>
1599
+ <td>
1600
+ <pre class="lines">
1601
+
1602
+
1603
+ 19
1604
+ 20
1605
+ 21</pre>
1606
+ </td>
1607
+ <td>
1608
+ <pre class="code"><span class="info file"># File 'lib/prismic/api.rb', line 19</span>
1609
+
1610
+ <span class='kw'>def</span> <span class='id identifier rubyid_tags'>tags</span>
1611
+ <span class='ivar'>@tags</span>
1612
+ <span class='kw'>end</span></pre>
1613
+ </td>
1614
+ </tr>
1615
+ </table>
1616
+ </div>
1617
+
1618
+
1619
+ <span id="types=-instance_method"></span>
1620
+ <div class="method_details ">
1621
+ <h3 class="signature " id="types-instance_method">
1622
+
1623
+ - (<tt>Object</tt>) <strong>types</strong>
1624
+
1625
+
1626
+
1627
+
1628
+
1629
+ </h3><div class="docstring">
1630
+ <div class="discussion">
1631
+ <p>Returns the value of attribute types</p>
1632
+
1633
+
1634
+ </div>
1635
+ </div>
1636
+ <div class="tags">
1637
+
1638
+
1639
+ </div><table class="source_code">
1640
+ <tr>
1641
+ <td>
1642
+ <pre class="lines">
1643
+
1644
+
1645
+ 19
1646
+ 20
1647
+ 21</pre>
1648
+ </td>
1649
+ <td>
1650
+ <pre class="code"><span class="info file"># File 'lib/prismic/api.rb', line 19</span>
1651
+
1652
+ <span class='kw'>def</span> <span class='id identifier rubyid_types'>types</span>
1653
+ <span class='ivar'>@types</span>
1654
+ <span class='kw'>end</span></pre>
1655
+ </td>
1656
+ </tr>
1657
+ </table>
1658
+ </div>
1659
+
1660
+ </div>
1661
+
1662
+
1663
+ <div id="class_method_details" class="method_details_list">
1664
+ <h2>Class Method Details</h2>
1665
+
1666
+
1667
+ <div class="method_details first">
1668
+ <h3 class="signature first" id="get-class_method">
1669
+
1670
+ + (<tt>Object</tt>) <strong>get</strong>(url, access_token = nil, http_client = Prismic::DefaultHTTPClient, api_cache = Prismic::DefaultCache)
1671
+
1672
+
1673
+
1674
+
1675
+
1676
+ </h3><div class="docstring">
1677
+ <div class="discussion">
1678
+ <p>Fetch the API information from the Prismic.io server</p>
1679
+
1680
+
1681
+ </div>
1682
+ </div>
1683
+ <div class="tags">
1684
+
1685
+
1686
+ </div><table class="source_code">
1687
+ <tr>
1688
+ <td>
1689
+ <pre class="lines">
1690
+
1691
+
1692
+ 151
1693
+ 152
1694
+ 153
1695
+ 154
1696
+ 155
1697
+ 156
1698
+ 157
1699
+ 158
1700
+ 159
1701
+ 160
1702
+ 161
1703
+ 162
1704
+ 163
1705
+ 164
1706
+ 165
1707
+ 166
1708
+ 167
1709
+ 168
1710
+ 169
1711
+ 170
1712
+ 171
1713
+ 172
1714
+ 173
1715
+ 174
1716
+ 175
1717
+ 176</pre>
1718
+ </td>
1719
+ <td>
1720
+ <pre class="code"><span class="info file"># File 'lib/prismic/api.rb', line 151</span>
1721
+
1722
+ <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='id identifier rubyid_url'>url</span><span class='comma'>,</span> <span class='id identifier rubyid_access_token'>access_token</span><span class='op'>=</span><span class='kw'>nil</span><span class='comma'>,</span> <span class='id identifier rubyid_http_client'>http_client</span><span class='op'>=</span><span class='const'>Prismic</span><span class='op'>::</span><span class='const'>DefaultHTTPClient</span><span class='comma'>,</span> <span class='id identifier rubyid_api_cache'>api_cache</span><span class='op'>=</span><span class='const'>Prismic</span><span class='op'>::</span><span class='const'>DefaultCache</span><span class='rparen'>)</span>
1723
+ <span class='id identifier rubyid_data'>data</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
1724
+ <span class='id identifier rubyid_data'>data</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>access_token</span><span class='tstring_end'>&#39;</span></span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_access_token'>access_token</span> <span class='kw'>if</span> <span class='id identifier rubyid_access_token'>access_token</span>
1725
+ <span class='id identifier rubyid_cache_key'>cache_key</span> <span class='op'>=</span> <span class='id identifier rubyid_url'>url</span> <span class='op'>+</span> <span class='lparen'>(</span><span class='id identifier rubyid_access_token'>access_token</span> <span class='op'>?</span> <span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>#</span><span class='tstring_end'>&#39;</span></span> <span class='op'>+</span> <span class='id identifier rubyid_access_token'>access_token</span><span class='rparen'>)</span> <span class='op'>:</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_end'>&#39;</span></span><span class='rparen'>)</span>
1726
+ <span class='id identifier rubyid_api_cache'>api_cache</span><span class='period'>.</span><span class='id identifier rubyid_get_or_set'>get_or_set</span><span class='lparen'>(</span><span class='id identifier rubyid_cache_key'>cache_key</span><span class='comma'>,</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='int'>5</span><span class='rparen'>)</span> <span class='lbrace'>{</span>
1727
+ <span class='id identifier rubyid_res'>res</span> <span class='op'>=</span> <span class='id identifier rubyid_http_client'>http_client</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='id identifier rubyid_url'>url</span><span class='comma'>,</span> <span class='id identifier rubyid_data'>data</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Accept</span><span class='tstring_end'>&#39;</span></span> <span class='op'>=&gt;</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>application/json</span><span class='tstring_end'>&#39;</span></span><span class='rparen'>)</span>
1728
+ <span class='kw'>case</span> <span class='id identifier rubyid_res'>res</span><span class='period'>.</span><span class='id identifier rubyid_code'>code</span>
1729
+ <span class='kw'>when</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>200</span><span class='tstring_end'>&#39;</span></span>
1730
+ <span class='id identifier rubyid_res'>res</span>
1731
+ <span class='kw'>when</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>401</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>403</span><span class='tstring_end'>&#39;</span></span>
1732
+ <span class='kw'>begin</span>
1733
+ <span class='id identifier rubyid_json'>json</span> <span class='op'>=</span> <span class='const'>JSON</span><span class='period'>.</span><span class='id identifier rubyid_load'>load</span><span class='lparen'>(</span><span class='id identifier rubyid_res'>res</span><span class='period'>.</span><span class='id identifier rubyid_body'>body</span><span class='rparen'>)</span>
1734
+ <span class='id identifier rubyid_raise'>raise</span> <span class='const'>PrismicWSAuthError</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span>
1735
+ <span class='id identifier rubyid_json'>json</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>error</span><span class='tstring_end'>&#39;</span></span><span class='rbracket'>]</span><span class='comma'>,</span>
1736
+ <span class='id identifier rubyid_json'>json</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>oauth_initiate</span><span class='tstring_end'>&#39;</span></span><span class='rbracket'>]</span><span class='comma'>,</span>
1737
+ <span class='id identifier rubyid_json'>json</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>oauth_token</span><span class='tstring_end'>&#39;</span></span><span class='rbracket'>]</span><span class='comma'>,</span>
1738
+ <span class='id identifier rubyid_http_client'>http_client</span>
1739
+ <span class='rparen'>)</span>
1740
+ <span class='kw'>rescue</span> <span class='op'>=&gt;</span> <span class='id identifier rubyid_e'>e</span>
1741
+ <span class='id identifier rubyid_raise'>raise</span> <span class='const'>PrismicWSConnectionError</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_res'>res</span><span class='comma'>,</span> <span class='id identifier rubyid_e'>e</span><span class='rparen'>)</span>
1742
+ <span class='kw'>end</span>
1743
+ <span class='kw'>else</span>
1744
+ <span class='id identifier rubyid_raise'>raise</span> <span class='const'>PrismicWSConnectionError</span><span class='comma'>,</span> <span class='id identifier rubyid_res'>res</span>
1745
+ <span class='kw'>end</span>
1746
+ <span class='rbrace'>}</span>
1747
+ <span class='kw'>end</span></pre>
1748
+ </td>
1749
+ </tr>
1750
+ </table>
1751
+ </div>
1752
+
1753
+ <div class="method_details ">
1754
+ <h3 class="signature " id="oauth_check_token-class_method">
1755
+
1756
+ + (<tt>Object</tt>) <strong>oauth_check_token</strong>(url, oauth_params, api_opts = {})
1757
+
1758
+
1759
+
1760
+
1761
+
1762
+ </h3><table class="source_code">
1763
+ <tr>
1764
+ <td>
1765
+ <pre class="lines">
1766
+
1767
+
1768
+ 229
1769
+ 230
1770
+ 231
1771
+ 232
1772
+ 233
1773
+ 234
1774
+ 235
1775
+ 236
1776
+ 237
1777
+ 238</pre>
1778
+ </td>
1779
+ <td>
1780
+ <pre class="code"><span class="info file"># File 'lib/prismic/api.rb', line 229</span>
1781
+
1782
+ <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_oauth_check_token'>oauth_check_token</span><span class='lparen'>(</span><span class='id identifier rubyid_url'>url</span><span class='comma'>,</span> <span class='id identifier rubyid_oauth_params'>oauth_params</span><span class='comma'>,</span> <span class='id identifier rubyid_api_opts'>api_opts</span><span class='op'>=</span><span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
1783
+ <span class='id identifier rubyid_oauth'>oauth</span> <span class='op'>=</span>
1784
+ <span class='kw'>begin</span>
1785
+ <span class='id identifier rubyid_api'>api</span> <span class='op'>=</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_start'>start</span><span class='lparen'>(</span><span class='id identifier rubyid_url'>url</span><span class='comma'>,</span> <span class='id identifier rubyid_api_opts'>api_opts</span><span class='rparen'>)</span>
1786
+ <span class='id identifier rubyid_api'>api</span><span class='period'>.</span><span class='id identifier rubyid_oauth'>oauth</span>
1787
+ <span class='kw'>rescue</span> <span class='const'>PrismicWSAuthError</span> <span class='op'>=&gt;</span> <span class='id identifier rubyid_e'>e</span>
1788
+ <span class='id identifier rubyid_e'>e</span><span class='period'>.</span><span class='id identifier rubyid_oauth'>oauth</span>
1789
+ <span class='kw'>end</span>
1790
+ <span class='id identifier rubyid_oauth'>oauth</span><span class='period'>.</span><span class='id identifier rubyid_check_token'>check_token</span><span class='lparen'>(</span><span class='id identifier rubyid_oauth_params'>oauth_params</span><span class='rparen'>)</span>
1791
+ <span class='kw'>end</span></pre>
1792
+ </td>
1793
+ </tr>
1794
+ </table>
1795
+ </div>
1796
+
1797
+ <div class="method_details ">
1798
+ <h3 class="signature " id="oauth_initiate_url-class_method">
1799
+
1800
+ + (<tt>Object</tt>) <strong>oauth_initiate_url</strong>(url, oauth_opts, api_opts = {})
1801
+
1802
+
1803
+
1804
+
1805
+
1806
+ </h3><table class="source_code">
1807
+ <tr>
1808
+ <td>
1809
+ <pre class="lines">
1810
+
1811
+
1812
+ 209
1813
+ 210
1814
+ 211
1815
+ 212
1816
+ 213
1817
+ 214
1818
+ 215
1819
+ 216
1820
+ 217
1821
+ 218</pre>
1822
+ </td>
1823
+ <td>
1824
+ <pre class="code"><span class="info file"># File 'lib/prismic/api.rb', line 209</span>
1825
+
1826
+ <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_oauth_initiate_url'>oauth_initiate_url</span><span class='lparen'>(</span><span class='id identifier rubyid_url'>url</span><span class='comma'>,</span> <span class='id identifier rubyid_oauth_opts'>oauth_opts</span><span class='comma'>,</span> <span class='id identifier rubyid_api_opts'>api_opts</span><span class='op'>=</span><span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
1827
+ <span class='id identifier rubyid_oauth'>oauth</span> <span class='op'>=</span>
1828
+ <span class='kw'>begin</span>
1829
+ <span class='id identifier rubyid_api'>api</span> <span class='op'>=</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_start'>start</span><span class='lparen'>(</span><span class='id identifier rubyid_url'>url</span><span class='comma'>,</span> <span class='id identifier rubyid_api_opts'>api_opts</span><span class='rparen'>)</span>
1830
+ <span class='id identifier rubyid_api'>api</span><span class='period'>.</span><span class='id identifier rubyid_oauth'>oauth</span>
1831
+ <span class='kw'>rescue</span> <span class='const'>PrismicWSAuthError</span> <span class='op'>=&gt;</span> <span class='id identifier rubyid_e'>e</span>
1832
+ <span class='id identifier rubyid_e'>e</span><span class='period'>.</span><span class='id identifier rubyid_oauth'>oauth</span>
1833
+ <span class='kw'>end</span>
1834
+ <span class='id identifier rubyid_oauth'>oauth</span><span class='period'>.</span><span class='id identifier rubyid_initiate_url'>initiate_url</span><span class='lparen'>(</span><span class='id identifier rubyid_oauth_opts'>oauth_opts</span><span class='rparen'>)</span>
1835
+ <span class='kw'>end</span></pre>
1836
+ </td>
1837
+ </tr>
1838
+ </table>
1839
+ </div>
1840
+
1841
+ <div class="method_details ">
1842
+ <h3 class="signature " id="parse_api_response-class_method">
1843
+
1844
+ + (<tt>Object</tt>) <strong>parse_api_response</strong>(data, access_token, http_client, cache)
1845
+
1846
+
1847
+
1848
+
1849
+
1850
+ </h3><table class="source_code">
1851
+ <tr>
1852
+ <td>
1853
+ <pre class="lines">
1854
+
1855
+
1856
+ 190
1857
+ 191
1858
+ 192
1859
+ 193
1860
+ 194
1861
+ 195
1862
+ 196
1863
+ 197
1864
+ 198
1865
+ 199
1866
+ 200
1867
+ 201
1868
+ 202
1869
+ 203
1870
+ 204
1871
+ 205
1872
+ 206
1873
+ 207</pre>
1874
+ </td>
1875
+ <td>
1876
+ <pre class="code"><span class="info file"># File 'lib/prismic/api.rb', line 190</span>
1877
+
1878
+ <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_parse_api_response'>parse_api_response</span><span class='lparen'>(</span><span class='id identifier rubyid_data'>data</span><span class='comma'>,</span> <span class='id identifier rubyid_access_token'>access_token</span><span class='comma'>,</span> <span class='id identifier rubyid_http_client'>http_client</span><span class='comma'>,</span> <span class='id identifier rubyid_cache'>cache</span><span class='rparen'>)</span>
1879
+ <span class='id identifier rubyid_data_forms'>data_forms</span> <span class='op'>=</span> <span class='id identifier rubyid_data'>data</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>forms</span><span class='tstring_end'>&#39;</span></span><span class='rbracket'>]</span> <span class='op'>||</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
1880
+ <span class='id identifier rubyid_data_refs'>data_refs</span> <span class='op'>=</span> <span class='id identifier rubyid_data'>data</span><span class='period'>.</span><span class='id identifier rubyid_fetch'>fetch</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>refs</span><span class='tstring_end'>&#39;</span></span><span class='rparen'>)</span><span class='lbrace'>{</span> <span class='id identifier rubyid_raise'>raise</span> <span class='const'>BadPrismicResponseError</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>No refs given</span><span class='tstring_end'>&quot;</span></span> <span class='rbrace'>}</span>
1881
+ <span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_data'>data</span><span class='comma'>,</span> <span class='id identifier rubyid_access_token'>access_token</span><span class='comma'>,</span> <span class='id identifier rubyid_http_client'>http_client</span><span class='comma'>,</span> <span class='id identifier rubyid_cache'>cache</span><span class='rparen'>)</span> <span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_api'>api</span><span class='op'>|</span>
1882
+ <span class='id identifier rubyid_api'>api</span><span class='period'>.</span><span class='id identifier rubyid_bookmarks'>bookmarks</span> <span class='op'>=</span> <span class='id identifier rubyid_data'>data</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>bookmarks</span><span class='tstring_end'>&#39;</span></span><span class='rbracket'>]</span>
1883
+ <span class='id identifier rubyid_api'>api</span><span class='period'>.</span><span class='id identifier rubyid_forms'>forms</span> <span class='op'>=</span> <span class='const'>Hash</span><span class='lbracket'>[</span><span class='id identifier rubyid_data_forms'>data_forms</span><span class='period'>.</span><span class='id identifier rubyid_map'>map</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_k'>k</span><span class='comma'>,</span> <span class='id identifier rubyid_form'>form</span><span class='op'>|</span>
1884
+ <span class='lbracket'>[</span><span class='id identifier rubyid_k'>k</span><span class='comma'>,</span> <span class='const'>Form</span><span class='period'>.</span><span class='id identifier rubyid_from_json'>from_json</span><span class='lparen'>(</span><span class='id identifier rubyid_api'>api</span><span class='comma'>,</span> <span class='id identifier rubyid_form'>form</span><span class='rparen'>)</span><span class='rbracket'>]</span>
1885
+ <span class='rbrace'>}</span><span class='rbracket'>]</span>
1886
+ <span class='id identifier rubyid_api'>api</span><span class='period'>.</span><span class='id identifier rubyid_refs'>refs</span> <span class='op'>=</span> <span class='const'>Hash</span><span class='lbracket'>[</span><span class='id identifier rubyid_data_refs'>data_refs</span><span class='period'>.</span><span class='id identifier rubyid_map'>map</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_ref'>ref</span><span class='op'>|</span>
1887
+ <span class='id identifier rubyid_scheduled_at'>scheduled_at</span> <span class='op'>=</span> <span class='id identifier rubyid_ref'>ref</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>scheduledAt</span><span class='tstring_end'>&#39;</span></span><span class='rbracket'>]</span>
1888
+ <span class='lbracket'>[</span><span class='id identifier rubyid_ref'>ref</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>label</span><span class='tstring_end'>&#39;</span></span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_downcase'>downcase</span><span class='comma'>,</span> <span class='const'>Ref</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_ref'>ref</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>id</span><span class='tstring_end'>&#39;</span></span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='id identifier rubyid_ref'>ref</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>ref</span><span class='tstring_end'>&#39;</span></span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='id identifier rubyid_ref'>ref</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>label</span><span class='tstring_end'>&#39;</span></span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='id identifier rubyid_ref'>ref</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>isMasterRef</span><span class='tstring_end'>&#39;</span></span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='id identifier rubyid_scheduled_at'>scheduled_at</span> <span class='op'>&amp;&amp;</span> <span class='const'>Time</span><span class='period'>.</span><span class='id identifier rubyid_at'>at</span><span class='lparen'>(</span><span class='id identifier rubyid_scheduled_at'>scheduled_at</span> <span class='op'>/</span> <span class='float'>1000.0</span><span class='rparen'>)</span><span class='rparen'>)</span><span class='rbracket'>]</span>
1889
+ <span class='rbrace'>}</span><span class='rbracket'>]</span>
1890
+ <span class='id identifier rubyid_api'>api</span><span class='period'>.</span><span class='id identifier rubyid_tags'>tags</span> <span class='op'>=</span> <span class='id identifier rubyid_data'>data</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>tags</span><span class='tstring_end'>&#39;</span></span><span class='rbracket'>]</span>
1891
+ <span class='id identifier rubyid_api'>api</span><span class='period'>.</span><span class='id identifier rubyid_types'>types</span> <span class='op'>=</span> <span class='id identifier rubyid_data'>data</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>types</span><span class='tstring_end'>&#39;</span></span><span class='rbracket'>]</span>
1892
+ <span class='id identifier rubyid_api'>api</span><span class='period'>.</span><span class='id identifier rubyid_oauth'>oauth</span> <span class='op'>=</span> <span class='const'>OAuth</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_data'>data</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>oauth_initiate</span><span class='tstring_end'>&#39;</span></span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='id identifier rubyid_data'>data</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>oauth_token</span><span class='tstring_end'>&#39;</span></span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='id identifier rubyid_http_client'>http_client</span><span class='rparen'>)</span>
1893
+ <span class='id identifier rubyid_api'>api</span><span class='period'>.</span><span class='id identifier rubyid_experiments'>experiments</span> <span class='op'>=</span> <span class='const'>Experiments</span><span class='period'>.</span><span class='id identifier rubyid_parse'>parse</span><span class='lparen'>(</span><span class='id identifier rubyid_data'>data</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>experiments</span><span class='tstring_end'>&#39;</span></span><span class='rbracket'>]</span><span class='rparen'>)</span>
1894
+ <span class='rbrace'>}</span>
1895
+ <span class='kw'>end</span></pre>
1896
+ </td>
1897
+ </tr>
1898
+ </table>
1899
+ </div>
1900
+
1901
+ <div class="method_details ">
1902
+ <h3 class="signature " id="start-class_method">
1903
+
1904
+ + (<tt>Object</tt>) <strong>start</strong>(url, opts = {})
1905
+
1906
+
1907
+
1908
+
1909
+
1910
+ </h3><table class="source_code">
1911
+ <tr>
1912
+ <td>
1913
+ <pre class="lines">
1914
+
1915
+
1916
+ 178
1917
+ 179
1918
+ 180
1919
+ 181
1920
+ 182
1921
+ 183
1922
+ 184
1923
+ 185
1924
+ 186
1925
+ 187
1926
+ 188</pre>
1927
+ </td>
1928
+ <td>
1929
+ <pre class="code"><span class="info file"># File 'lib/prismic/api.rb', line 178</span>
1930
+
1931
+ <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_start'>start</span><span class='lparen'>(</span><span class='id identifier rubyid_url'>url</span><span class='comma'>,</span> <span class='id identifier rubyid_opts'>opts</span><span class='op'>=</span><span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
1932
+ <span class='id identifier rubyid_http_client'>http_client</span> <span class='op'>=</span> <span class='id identifier rubyid_opts'>opts</span><span class='lbracket'>[</span><span class='symbol'>:http_client</span><span class='rbracket'>]</span> <span class='op'>||</span> <span class='const'>Prismic</span><span class='op'>::</span><span class='const'>DefaultHTTPClient</span>
1933
+ <span class='id identifier rubyid_access_token'>access_token</span> <span class='op'>=</span> <span class='id identifier rubyid_opts'>opts</span><span class='lbracket'>[</span><span class='symbol'>:access_token</span><span class='rbracket'>]</span>
1934
+ <span class='comment'># We don&#39;t use ||= because we want to keep the DefaultCache if nil was explicitly passed
1935
+ </span> <span class='id identifier rubyid_api_cache'>api_cache</span> <span class='op'>=</span> <span class='id identifier rubyid_opts'>opts</span><span class='period'>.</span><span class='id identifier rubyid_has_key?'>has_key?</span><span class='lparen'>(</span><span class='symbol'>:api_cache</span><span class='rparen'>)</span> <span class='op'>?</span> <span class='id identifier rubyid_opts'>opts</span><span class='lbracket'>[</span><span class='symbol'>:api_cache</span><span class='rbracket'>]</span> <span class='op'>:</span> <span class='const'>Prismic</span><span class='op'>::</span><span class='const'>DefaultCache</span>
1936
+ <span class='id identifier rubyid_cache'>cache</span> <span class='op'>=</span> <span class='id identifier rubyid_opts'>opts</span><span class='period'>.</span><span class='id identifier rubyid_has_key?'>has_key?</span><span class='lparen'>(</span><span class='symbol'>:cache</span><span class='rparen'>)</span> <span class='op'>?</span> <span class='id identifier rubyid_opts'>opts</span><span class='lbracket'>[</span><span class='symbol'>:cache</span><span class='rbracket'>]</span> <span class='op'>:</span> <span class='const'>Prismic</span><span class='op'>::</span><span class='const'>DefaultCache</span>
1937
+
1938
+ <span class='id identifier rubyid_resp'>resp</span> <span class='op'>=</span> <span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='id identifier rubyid_url'>url</span><span class='comma'>,</span> <span class='id identifier rubyid_access_token'>access_token</span><span class='comma'>,</span> <span class='id identifier rubyid_http_client'>http_client</span><span class='comma'>,</span> <span class='id identifier rubyid_api_cache'>api_cache</span><span class='rparen'>)</span>
1939
+ <span class='id identifier rubyid_json'>json</span> <span class='op'>=</span> <span class='const'>JSON</span><span class='period'>.</span><span class='id identifier rubyid_load'>load</span><span class='lparen'>(</span><span class='id identifier rubyid_resp'>resp</span><span class='period'>.</span><span class='id identifier rubyid_body'>body</span><span class='rparen'>)</span>
1940
+ <span class='id identifier rubyid_parse_api_response'>parse_api_response</span><span class='lparen'>(</span><span class='id identifier rubyid_json'>json</span><span class='comma'>,</span> <span class='id identifier rubyid_access_token'>access_token</span><span class='comma'>,</span> <span class='id identifier rubyid_http_client'>http_client</span><span class='comma'>,</span> <span class='id identifier rubyid_cache'>cache</span><span class='rparen'>)</span>
1941
+ <span class='kw'>end</span></pre>
1942
+ </td>
1943
+ </tr>
1944
+ </table>
1945
+ </div>
1946
+
1947
+ </div>
1948
+
1949
+ <div id="instance_method_details" class="method_details_list">
1950
+ <h2>Instance Method Details</h2>
1951
+
1952
+
1953
+ <div class="method_details first">
1954
+ <h3 class="signature first" id="all-instance_method">
1955
+
1956
+ - (<tt>Object</tt>) <strong>all</strong>(data = {})
1957
+
1958
+
1959
+
1960
+
1961
+
1962
+ </h3><div class="docstring">
1963
+ <div class="discussion">
1964
+ <p>Retrieve all documents (paginated)</p>
1965
+
1966
+
1967
+ </div>
1968
+ </div>
1969
+ <div class="tags">
1970
+ <p class="tag_title">Parameters:</p>
1971
+ <ul class="param">
1972
+
1973
+ <li>
1974
+
1975
+ <span class='name'>data</span>
1976
+
1977
+
1978
+ <span class='type'>(<tt>Hash</tt>)</span>
1979
+
1980
+
1981
+ <em class="default">(defaults to: <tt>{}</tt>)</em>
1982
+
1983
+
1984
+ &mdash;
1985
+ <div class='inline'><p>query options (page, pageSize, ref, etc.)</p>
1986
+ </div>
1987
+
1988
+ </li>
1989
+
1990
+ </ul>
1991
+
1992
+
1993
+ </div><table class="source_code">
1994
+ <tr>
1995
+ <td>
1996
+ <pre class="lines">
1997
+
1998
+
1999
+ 96
2000
+ 97
2001
+ 98
2002
+ 99</pre>
2003
+ </td>
2004
+ <td>
2005
+ <pre class="code"><span class="info file"># File 'lib/prismic/api.rb', line 96</span>
2006
+
2007
+ <span class='kw'>def</span> <span class='id identifier rubyid_all'>all</span><span class='lparen'>(</span><span class='id identifier rubyid_data'>data</span><span class='op'>=</span><span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
2008
+ <span class='id identifier rubyid_ref'>ref</span> <span class='op'>=</span> <span class='id identifier rubyid_data'>data</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>ref</span><span class='tstring_end'>&#39;</span></span><span class='rbracket'>]</span> <span class='op'>||</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_master'>master</span><span class='period'>.</span><span class='id identifier rubyid_ref'>ref</span>
2009
+ <span class='id identifier rubyid_form'>form</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>everything</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span> <span class='id identifier rubyid_data'>data</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_submit'>submit</span><span class='lparen'>(</span><span class='id identifier rubyid_ref'>ref</span><span class='rparen'>)</span>
2010
+ <span class='kw'>end</span></pre>
2011
+ </td>
2012
+ </tr>
2013
+ </table>
2014
+ </div>
2015
+
2016
+ <div class="method_details ">
2017
+ <h3 class="signature " id="as_json-instance_method">
2018
+
2019
+ - (<tt>Object</tt>) <strong>as_json</strong>
2020
+
2021
+
2022
+
2023
+
2024
+
2025
+ </h3><table class="source_code">
2026
+ <tr>
2027
+ <td>
2028
+ <pre class="lines">
2029
+
2030
+
2031
+ 146
2032
+ 147
2033
+ 148</pre>
2034
+ </td>
2035
+ <td>
2036
+ <pre class="code"><span class="info file"># File 'lib/prismic/api.rb', line 146</span>
2037
+
2038
+ <span class='kw'>def</span> <span class='id identifier rubyid_as_json'>as_json</span>
2039
+ <span class='ivar'>@json</span>
2040
+ <span class='kw'>end</span></pre>
2041
+ </td>
2042
+ </tr>
2043
+ </table>
2044
+ </div>
2045
+
2046
+ <div class="method_details ">
2047
+ <h3 class="signature " id="bookmark-instance_method">
2048
+
2049
+ - (<tt>String</tt>) <strong>bookmark</strong>(name)
2050
+
2051
+
2052
+
2053
+
2054
+
2055
+ </h3><div class="docstring">
2056
+ <div class="discussion">
2057
+ <p>Get a bookmark by its name</p>
2058
+
2059
+
2060
+ </div>
2061
+ </div>
2062
+ <div class="tags">
2063
+ <p class="tag_title">Parameters:</p>
2064
+ <ul class="param">
2065
+
2066
+ <li>
2067
+
2068
+ <span class='name'>The</span>
2069
+
2070
+
2071
+ <span class='type'>(<tt>String</tt>)</span>
2072
+
2073
+
2074
+
2075
+ &mdash;
2076
+ <div class='inline'><p>bookmark&#39;s name</p>
2077
+ </div>
2078
+
2079
+ </li>
2080
+
2081
+ </ul>
2082
+
2083
+ <p class="tag_title">Returns:</p>
2084
+ <ul class="return">
2085
+
2086
+ <li>
2087
+
2088
+
2089
+ <span class='type'>(<tt>String</tt>)</span>
2090
+
2091
+
2092
+
2093
+ &mdash;
2094
+ <div class='inline'><p>The bookmark document id</p>
2095
+ </div>
2096
+
2097
+ </li>
2098
+
2099
+ </ul>
2100
+
2101
+ </div><table class="source_code">
2102
+ <tr>
2103
+ <td>
2104
+ <pre class="lines">
2105
+
2106
+
2107
+ 52
2108
+ 53
2109
+ 54</pre>
2110
+ </td>
2111
+ <td>
2112
+ <pre class="code"><span class="info file"># File 'lib/prismic/api.rb', line 52</span>
2113
+
2114
+ <span class='kw'>def</span> <span class='id identifier rubyid_bookmark'>bookmark</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='rparen'>)</span>
2115
+ <span class='id identifier rubyid_bookmarks'>bookmarks</span><span class='lbracket'>[</span><span class='id identifier rubyid_name'>name</span><span class='rbracket'>]</span>
2116
+ <span class='kw'>end</span></pre>
2117
+ </td>
2118
+ </tr>
2119
+ </table>
2120
+ </div>
2121
+
2122
+ <div class="method_details ">
2123
+ <h3 class="signature " id="create_search_form-instance_method">
2124
+
2125
+ - (<tt>Object</tt>) <strong>create_search_form</strong>(name, data = {}, ref = {})
2126
+
2127
+
2128
+
2129
+
2130
+
2131
+ </h3><div class="docstring">
2132
+ <div class="discussion">
2133
+ <div class="note deprecated"><strong>Deprecated.</strong> <div class='inline'><p>Use <span class='object_link'><a href="#form-instance_method" title="Prismic::API#form (method)">#form</a></span> instead.</p>
2134
+ </div></div>
2135
+
2136
+
2137
+ </div>
2138
+ </div>
2139
+ <div class="tags">
2140
+
2141
+
2142
+ </div><table class="source_code">
2143
+ <tr>
2144
+ <td>
2145
+ <pre class="lines">
2146
+
2147
+
2148
+ 78
2149
+ 79
2150
+ 80
2151
+ 81
2152
+ 82
2153
+ 83
2154
+ 84</pre>
2155
+ </td>
2156
+ <td>
2157
+ <pre class="code"><span class="info file"># File 'lib/prismic/api.rb', line 78</span>
2158
+
2159
+ <span class='kw'>def</span> <span class='id identifier rubyid_create_search_form'>create_search_form</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='comma'>,</span> <span class='id identifier rubyid_data'>data</span><span class='op'>=</span><span class='lbrace'>{</span><span class='rbrace'>}</span><span class='comma'>,</span> <span class='id identifier rubyid_ref'>ref</span><span class='op'>=</span><span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
2160
+ <span class='kw'>unless</span> <span class='cvar'>@@warned_create_search_form</span>
2161
+ <span class='id identifier rubyid_warn'>warn</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>[DEPRECATION] `create_search_form` is deprecated. Please use `form` instead.</span><span class='tstring_end'>&#39;</span></span>
2162
+ <span class='cvar'>@@warned_create_search_form</span> <span class='op'>=</span> <span class='kw'>true</span>
2163
+ <span class='kw'>end</span>
2164
+ <span class='id identifier rubyid_form'>form</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='comma'>,</span> <span class='id identifier rubyid_data'>data</span><span class='comma'>,</span> <span class='id identifier rubyid_ref'>ref</span><span class='rparen'>)</span>
2165
+ <span class='kw'>end</span></pre>
2166
+ </td>
2167
+ </tr>
2168
+ </table>
2169
+ </div>
2170
+
2171
+ <div class="method_details ">
2172
+ <h3 class="signature " id="form-instance_method">
2173
+
2174
+ - (<tt><span class='object_link'><a href="SearchForm.html" title="Prismic::SearchForm (class)">SearchForm</a></span></tt>) <strong>form</strong>(name, data = {}, ref = {})
2175
+
2176
+
2177
+
2178
+
2179
+
2180
+ </h3><div class="docstring">
2181
+ <div class="discussion">
2182
+ <p>Returns a <span class='object_link'><a href="SearchForm.html" title="Prismic::SearchForm (class)">search form</a></span> by its name. This is where you start to query a repository.</p>
2183
+
2184
+
2185
+ </div>
2186
+ </div>
2187
+ <div class="tags">
2188
+ <p class="tag_title">Parameters:</p>
2189
+ <ul class="param">
2190
+
2191
+ <li>
2192
+
2193
+ <span class='name'>name</span>
2194
+
2195
+
2196
+ <span class='type'>(<tt>String</tt>)</span>
2197
+
2198
+
2199
+
2200
+ &mdash;
2201
+ <div class='inline'><p>The name of the form</p>
2202
+ </div>
2203
+
2204
+ </li>
2205
+
2206
+ <li>
2207
+
2208
+ <span class='name'>data</span>
2209
+
2210
+
2211
+ <span class='type'>(<tt>Hash</tt>)</span>
2212
+
2213
+
2214
+ <em class="default">(defaults to: <tt>{}</tt>)</em>
2215
+
2216
+
2217
+ &mdash;
2218
+ <div class='inline'><p>Default values</p>
2219
+ </div>
2220
+
2221
+ </li>
2222
+
2223
+ <li>
2224
+
2225
+ <span class='name'>ref</span>
2226
+
2227
+
2228
+ <span class='type'>(<tt>type</tt>)</span>
2229
+
2230
+
2231
+ <em class="default">(defaults to: <tt>{}</tt>)</em>
2232
+
2233
+
2234
+ &mdash;
2235
+ <div class='inline'><p>Default <span class='object_link'><a href="Ref.html" title="Prismic::Ref (class)">reference</a></span></p>
2236
+ </div>
2237
+
2238
+ </li>
2239
+
2240
+ </ul>
2241
+
2242
+ <p class="tag_title">Returns:</p>
2243
+ <ul class="return">
2244
+
2245
+ <li>
2246
+
2247
+
2248
+ <span class='type'>(<tt><span class='object_link'><a href="SearchForm.html" title="Prismic::SearchForm (class)">SearchForm</a></span></tt>)</span>
2249
+
2250
+
2251
+
2252
+ &mdash;
2253
+ <div class='inline'><p>The search form</p>
2254
+ </div>
2255
+
2256
+ </li>
2257
+
2258
+ </ul>
2259
+
2260
+ </div><table class="source_code">
2261
+ <tr>
2262
+ <td>
2263
+ <pre class="lines">
2264
+
2265
+
2266
+ 72
2267
+ 73
2268
+ 74
2269
+ 75</pre>
2270
+ </td>
2271
+ <td>
2272
+ <pre class="code"><span class="info file"># File 'lib/prismic/api.rb', line 72</span>
2273
+
2274
+ <span class='kw'>def</span> <span class='id identifier rubyid_form'>form</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='comma'>,</span> <span class='id identifier rubyid_data'>data</span><span class='op'>=</span><span class='lbrace'>{</span><span class='rbrace'>}</span><span class='comma'>,</span> <span class='id identifier rubyid_ref'>ref</span><span class='op'>=</span><span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
2275
+ <span class='id identifier rubyid_form'>form</span> <span class='op'>=</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_forms'>forms</span><span class='lbracket'>[</span><span class='id identifier rubyid_name'>name</span><span class='rbracket'>]</span>
2276
+ <span class='id identifier rubyid_form'>form</span> <span class='kw'>and</span> <span class='id identifier rubyid_form'>form</span><span class='period'>.</span><span class='id identifier rubyid_create_search_form'>create_search_form</span><span class='lparen'>(</span><span class='id identifier rubyid_data'>data</span><span class='comma'>,</span> <span class='id identifier rubyid_ref'>ref</span><span class='rparen'>)</span>
2277
+ <span class='kw'>end</span></pre>
2278
+ </td>
2279
+ </tr>
2280
+ </table>
2281
+ </div>
2282
+
2283
+ <div class="method_details ">
2284
+ <h3 class="signature " id="getByID-instance_method">
2285
+
2286
+ - (<tt>Object</tt>) <strong>getByID</strong>(id, data = {})
2287
+
2288
+
2289
+
2290
+
2291
+
2292
+ </h3><div class="docstring">
2293
+ <div class="discussion">
2294
+ <p>Retrieve one document by its id</p>
2295
+
2296
+
2297
+ </div>
2298
+ </div>
2299
+ <div class="tags">
2300
+ <p class="tag_title">Parameters:</p>
2301
+ <ul class="param">
2302
+
2303
+ <li>
2304
+
2305
+ <span class='name'>q</span>
2306
+
2307
+
2308
+ <span class='type'>(<tt>String</tt>)</span>
2309
+
2310
+
2311
+
2312
+ &mdash;
2313
+ <div class='inline'><p>the query to perform</p>
2314
+ </div>
2315
+
2316
+ </li>
2317
+
2318
+ <li>
2319
+
2320
+ <span class='name'>data</span>
2321
+
2322
+
2323
+ <span class='type'>(<tt>Hash</tt>)</span>
2324
+
2325
+
2326
+ <em class="default">(defaults to: <tt>{}</tt>)</em>
2327
+
2328
+
2329
+ &mdash;
2330
+ <div class='inline'><p>query options (page, pageSize, ref, etc.)</p>
2331
+ </div>
2332
+
2333
+ </li>
2334
+
2335
+ </ul>
2336
+
2337
+ <p class="tag_title">Returns:</p>
2338
+ <ul class="return">
2339
+
2340
+ <li>
2341
+
2342
+
2343
+ <span class='type'></span>
2344
+
2345
+
2346
+
2347
+
2348
+ <div class='inline'><p>the document, or nil if not found</p>
2349
+ </div>
2350
+
2351
+ </li>
2352
+
2353
+ </ul>
2354
+
2355
+ </div><table class="source_code">
2356
+ <tr>
2357
+ <td>
2358
+ <pre class="lines">
2359
+
2360
+
2361
+ 105
2362
+ 106
2363
+ 107</pre>
2364
+ </td>
2365
+ <td>
2366
+ <pre class="code"><span class="info file"># File 'lib/prismic/api.rb', line 105</span>
2367
+
2368
+ <span class='kw'>def</span> <span class='id identifier rubyid_getByID'>getByID</span><span class='lparen'>(</span><span class='id identifier rubyid_id'>id</span><span class='comma'>,</span> <span class='id identifier rubyid_data'>data</span><span class='op'>=</span><span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
2369
+ <span class='id identifier rubyid_query'>query</span><span class='lparen'>(</span><span class='const'>Prismic</span><span class='op'>::</span><span class='const'>Predicates</span><span class='op'>::</span><span class='id identifier rubyid_at'>at</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>document.id</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span> <span class='id identifier rubyid_id'>id</span><span class='rparen'>)</span><span class='comma'>,</span> <span class='id identifier rubyid_data'>data</span><span class='rparen'>)</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</span>
2370
+ <span class='kw'>end</span></pre>
2371
+ </td>
2372
+ </tr>
2373
+ </table>
2374
+ </div>
2375
+
2376
+ <div class="method_details ">
2377
+ <h3 class="signature " id="getByIDs-instance_method">
2378
+
2379
+ - (<tt>Object</tt>) <strong>getByIDs</strong>(ids, data = {})
2380
+
2381
+
2382
+
2383
+
2384
+
2385
+ </h3><div class="docstring">
2386
+ <div class="discussion">
2387
+ <p>Retrieve multiple documents by their ids</p>
2388
+
2389
+
2390
+ </div>
2391
+ </div>
2392
+ <div class="tags">
2393
+ <p class="tag_title">Parameters:</p>
2394
+ <ul class="param">
2395
+
2396
+ <li>
2397
+
2398
+ <span class='name'>q</span>
2399
+
2400
+
2401
+ <span class='type'>(<tt>String</tt>)</span>
2402
+
2403
+
2404
+
2405
+ &mdash;
2406
+ <div class='inline'><p>the query to perform</p>
2407
+ </div>
2408
+
2409
+ </li>
2410
+
2411
+ <li>
2412
+
2413
+ <span class='name'>data</span>
2414
+
2415
+
2416
+ <span class='type'>(<tt>Hash</tt>)</span>
2417
+
2418
+
2419
+ <em class="default">(defaults to: <tt>{}</tt>)</em>
2420
+
2421
+
2422
+ &mdash;
2423
+ <div class='inline'><p>query options (page, pageSize, ref, etc.)</p>
2424
+ </div>
2425
+
2426
+ </li>
2427
+
2428
+ </ul>
2429
+
2430
+ <p class="tag_title">Returns:</p>
2431
+ <ul class="return">
2432
+
2433
+ <li>
2434
+
2435
+
2436
+ <span class='type'></span>
2437
+
2438
+
2439
+
2440
+
2441
+ <div class='inline'><p>the document, or nil if not found</p>
2442
+ </div>
2443
+
2444
+ </li>
2445
+
2446
+ </ul>
2447
+
2448
+ </div><table class="source_code">
2449
+ <tr>
2450
+ <td>
2451
+ <pre class="lines">
2452
+
2453
+
2454
+ 121
2455
+ 122
2456
+ 123</pre>
2457
+ </td>
2458
+ <td>
2459
+ <pre class="code"><span class="info file"># File 'lib/prismic/api.rb', line 121</span>
2460
+
2461
+ <span class='kw'>def</span> <span class='id identifier rubyid_getByIDs'>getByIDs</span><span class='lparen'>(</span><span class='id identifier rubyid_ids'>ids</span><span class='comma'>,</span> <span class='id identifier rubyid_data'>data</span><span class='op'>=</span><span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
2462
+ <span class='id identifier rubyid_query'>query</span><span class='lparen'>(</span><span class='const'>Prismic</span><span class='op'>::</span><span class='const'>Predicates</span><span class='op'>::</span><span class='id identifier rubyid_in'>in</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>document.id</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span> <span class='id identifier rubyid_ids'>ids</span><span class='rparen'>)</span><span class='comma'>,</span> <span class='id identifier rubyid_data'>data</span><span class='rparen'>)</span>
2463
+ <span class='kw'>end</span></pre>
2464
+ </td>
2465
+ </tr>
2466
+ </table>
2467
+ </div>
2468
+
2469
+ <div class="method_details ">
2470
+ <h3 class="signature " id="getByUID-instance_method">
2471
+
2472
+ - (<tt>Object</tt>) <strong>getByUID</strong>(typ, uid, data = {})
2473
+
2474
+
2475
+
2476
+
2477
+
2478
+ </h3><div class="docstring">
2479
+ <div class="discussion">
2480
+ <p>Retrieve one document by its uid</p>
2481
+
2482
+
2483
+ </div>
2484
+ </div>
2485
+ <div class="tags">
2486
+ <p class="tag_title">Parameters:</p>
2487
+ <ul class="param">
2488
+
2489
+ <li>
2490
+
2491
+ <span class='name'>q</span>
2492
+
2493
+
2494
+ <span class='type'>(<tt>String</tt>)</span>
2495
+
2496
+
2497
+
2498
+ &mdash;
2499
+ <div class='inline'><p>the query to perform</p>
2500
+ </div>
2501
+
2502
+ </li>
2503
+
2504
+ <li>
2505
+
2506
+ <span class='name'>data</span>
2507
+
2508
+
2509
+ <span class='type'>(<tt>Hash</tt>)</span>
2510
+
2511
+
2512
+ <em class="default">(defaults to: <tt>{}</tt>)</em>
2513
+
2514
+
2515
+ &mdash;
2516
+ <div class='inline'><p>query options (page, pageSize, ref, etc.)</p>
2517
+ </div>
2518
+
2519
+ </li>
2520
+
2521
+ </ul>
2522
+
2523
+ <p class="tag_title">Returns:</p>
2524
+ <ul class="return">
2525
+
2526
+ <li>
2527
+
2528
+
2529
+ <span class='type'></span>
2530
+
2531
+
2532
+
2533
+
2534
+ <div class='inline'><p>the document, or nil if not found</p>
2535
+ </div>
2536
+
2537
+ </li>
2538
+
2539
+ </ul>
2540
+
2541
+ </div><table class="source_code">
2542
+ <tr>
2543
+ <td>
2544
+ <pre class="lines">
2545
+
2546
+
2547
+ 113
2548
+ 114
2549
+ 115</pre>
2550
+ </td>
2551
+ <td>
2552
+ <pre class="code"><span class="info file"># File 'lib/prismic/api.rb', line 113</span>
2553
+
2554
+ <span class='kw'>def</span> <span class='id identifier rubyid_getByUID'>getByUID</span><span class='lparen'>(</span><span class='id identifier rubyid_typ'>typ</span><span class='comma'>,</span> <span class='id identifier rubyid_uid'>uid</span><span class='comma'>,</span> <span class='id identifier rubyid_data'>data</span><span class='op'>=</span><span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
2555
+ <span class='id identifier rubyid_query'>query</span><span class='lparen'>(</span><span class='const'>Prismic</span><span class='op'>::</span><span class='const'>Predicates</span><span class='op'>::</span><span class='id identifier rubyid_at'>at</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>my.</span><span class='tstring_end'>&#39;</span></span><span class='op'>+</span><span class='id identifier rubyid_typ'>typ</span><span class='op'>+</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>.uid</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span> <span class='id identifier rubyid_uid'>uid</span><span class='rparen'>)</span><span class='comma'>,</span> <span class='id identifier rubyid_data'>data</span><span class='rparen'>)</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</span>
2556
+ <span class='kw'>end</span></pre>
2557
+ </td>
2558
+ </tr>
2559
+ </table>
2560
+ </div>
2561
+
2562
+ <div class="method_details ">
2563
+ <h3 class="signature " id="has_cache?-instance_method">
2564
+
2565
+ - (<tt>Boolean</tt>) <strong>has_cache?</strong>
2566
+
2567
+
2568
+
2569
+
2570
+
2571
+ </h3><div class="docstring">
2572
+ <div class="discussion">
2573
+ <p>Is the cache enabled on this API object?</p>
2574
+
2575
+
2576
+ </div>
2577
+ </div>
2578
+ <div class="tags">
2579
+
2580
+ <p class="tag_title">Returns:</p>
2581
+ <ul class="return">
2582
+
2583
+ <li>
2584
+
2585
+
2586
+ <span class='type'>(<tt>Boolean</tt>)</span>
2587
+
2588
+
2589
+
2590
+ </li>
2591
+
2592
+ </ul>
2593
+
2594
+ </div><table class="source_code">
2595
+ <tr>
2596
+ <td>
2597
+ <pre class="lines">
2598
+
2599
+
2600
+ 26
2601
+ 27
2602
+ 28</pre>
2603
+ </td>
2604
+ <td>
2605
+ <pre class="code"><span class="info file"># File 'lib/prismic/api.rb', line 26</span>
2606
+
2607
+ <span class='kw'>def</span> <span class='id identifier rubyid_has_cache?'>has_cache?</span>
2608
+ <span class='op'>!</span><span class='op'>!</span><span class='id identifier rubyid_cache'>cache</span>
2609
+ <span class='kw'>end</span></pre>
2610
+ </td>
2611
+ </tr>
2612
+ </table>
2613
+ </div>
2614
+
2615
+ <div class="method_details ">
2616
+ <h3 class="signature " id="oauth_check_token-instance_method">
2617
+
2618
+ - (<tt>Object</tt>) <strong>oauth_check_token</strong>(params)
2619
+
2620
+
2621
+
2622
+
2623
+
2624
+ </h3><table class="source_code">
2625
+ <tr>
2626
+ <td>
2627
+ <pre class="lines">
2628
+
2629
+
2630
+ 240
2631
+ 241
2632
+ 242
2633
+ 243
2634
+ 244
2635
+ 245
2636
+ 246
2637
+ 247</pre>
2638
+ </td>
2639
+ <td>
2640
+ <pre class="code"><span class="info file"># File 'lib/prismic/api.rb', line 240</span>
2641
+
2642
+ <span class='kw'>def</span> <span class='id identifier rubyid_oauth_check_token'>oauth_check_token</span><span class='lparen'>(</span><span class='id identifier rubyid_params'>params</span><span class='rparen'>)</span>
2643
+ <span class='kw'>unless</span> <span class='cvar'>@@warned_oauth_check_token</span>
2644
+ <span class='id identifier rubyid_warn'>warn</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>[DEPRECATION] Method `API#oauth_check_token` is deprecated. </span><span class='tstring_end'>&quot;</span></span> <span class='op'>+</span>
2645
+ <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Please use `Prismic::API.oauth_check_token` instead.</span><span class='tstring_end'>&quot;</span></span>
2646
+ <span class='cvar'>@@warned_oauth_check_token</span> <span class='op'>=</span> <span class='kw'>true</span>
2647
+ <span class='kw'>end</span>
2648
+ <span class='id identifier rubyid_oauth'>oauth</span><span class='period'>.</span><span class='id identifier rubyid_check_token'>check_token</span><span class='lparen'>(</span><span class='id identifier rubyid_params'>params</span><span class='rparen'>)</span>
2649
+ <span class='kw'>end</span></pre>
2650
+ </td>
2651
+ </tr>
2652
+ </table>
2653
+ </div>
2654
+
2655
+ <div class="method_details ">
2656
+ <h3 class="signature " id="oauth_initiate_url-instance_method">
2657
+
2658
+ - (<tt>Object</tt>) <strong>oauth_initiate_url</strong>(opts)
2659
+
2660
+
2661
+
2662
+
2663
+
2664
+ </h3><table class="source_code">
2665
+ <tr>
2666
+ <td>
2667
+ <pre class="lines">
2668
+
2669
+
2670
+ 220
2671
+ 221
2672
+ 222
2673
+ 223
2674
+ 224
2675
+ 225
2676
+ 226
2677
+ 227</pre>
2678
+ </td>
2679
+ <td>
2680
+ <pre class="code"><span class="info file"># File 'lib/prismic/api.rb', line 220</span>
2681
+
2682
+ <span class='kw'>def</span> <span class='id identifier rubyid_oauth_initiate_url'>oauth_initiate_url</span><span class='lparen'>(</span><span class='id identifier rubyid_opts'>opts</span><span class='rparen'>)</span>
2683
+ <span class='kw'>if</span> <span class='op'>!</span><span class='cvar'>@@warned_oauth_initiate_url</span>
2684
+ <span class='id identifier rubyid_warn'>warn</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>[DEPRECATION] Method `API#oauth_initiate_url` is deprecated. </span><span class='tstring_end'>&quot;</span></span> <span class='op'>+</span>
2685
+ <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Please use `Prismic::API.oauth_initiate_url` instead.</span><span class='tstring_end'>&quot;</span></span>
2686
+ <span class='cvar'>@@warned_oauth_initiate_url</span> <span class='op'>=</span> <span class='kw'>true</span>
2687
+ <span class='kw'>end</span>
2688
+ <span class='id identifier rubyid_oauth'>oauth</span><span class='period'>.</span><span class='id identifier rubyid_initiate_url'>initiate_url</span><span class='lparen'>(</span><span class='id identifier rubyid_opts'>opts</span><span class='rparen'>)</span>
2689
+ <span class='kw'>end</span></pre>
2690
+ </td>
2691
+ </tr>
2692
+ </table>
2693
+ </div>
2694
+
2695
+ <div class="method_details ">
2696
+ <h3 class="signature " id="preview_session-instance_method">
2697
+
2698
+ - (<tt>String</tt>) <strong>preview_session</strong>(token, link_resolver, default_url)
2699
+
2700
+
2701
+
2702
+
2703
+
2704
+ </h3><div class="docstring">
2705
+ <div class="discussion">
2706
+ <p>Return the URL to display a given preview
2707
+ (usually the home page of your site)</p>
2708
+
2709
+
2710
+ </div>
2711
+ </div>
2712
+ <div class="tags">
2713
+ <p class="tag_title">Parameters:</p>
2714
+ <ul class="param">
2715
+
2716
+ <li>
2717
+
2718
+ <span class='name'>token</span>
2719
+
2720
+
2721
+ <span class='type'>(<tt>String</tt>)</span>
2722
+
2723
+
2724
+
2725
+ &mdash;
2726
+ <div class='inline'><p>as received from Prismic server to identify the content to preview</p>
2727
+ </div>
2728
+
2729
+ </li>
2730
+
2731
+ <li>
2732
+
2733
+ <span class='name'>link_resolver</span>
2734
+
2735
+
2736
+ <span class='type'></span>
2737
+
2738
+
2739
+
2740
+ &mdash;
2741
+ <div class='inline'><p>the link resolver to build URL for your site</p>
2742
+ </div>
2743
+
2744
+ </li>
2745
+
2746
+ <li>
2747
+
2748
+ <span class='name'>default_url</span>
2749
+
2750
+
2751
+ <span class='type'>(<tt>String</tt>)</span>
2752
+
2753
+
2754
+
2755
+ &mdash;
2756
+ <div class='inline'><p>the URL to default to return if the preview doesn&#39;t correspond to a document</p>
2757
+ </div>
2758
+
2759
+ </li>
2760
+
2761
+ </ul>
2762
+
2763
+ <p class="tag_title">Returns:</p>
2764
+ <ul class="return">
2765
+
2766
+ <li>
2767
+
2768
+
2769
+ <span class='type'>(<tt>String</tt>)</span>
2770
+
2771
+
2772
+
2773
+ &mdash;
2774
+ <div class='inline'><p>the URL to redirect the user to</p>
2775
+ </div>
2776
+
2777
+ </li>
2778
+
2779
+ </ul>
2780
+
2781
+ </div><table class="source_code">
2782
+ <tr>
2783
+ <td>
2784
+ <pre class="lines">
2785
+
2786
+
2787
+ 132
2788
+ 133
2789
+ 134
2790
+ 135
2791
+ 136
2792
+ 137
2793
+ 138
2794
+ 139
2795
+ 140
2796
+ 141
2797
+ 142
2798
+ 143
2799
+ 144</pre>
2800
+ </td>
2801
+ <td>
2802
+ <pre class="code"><span class="info file"># File 'lib/prismic/api.rb', line 132</span>
2803
+
2804
+ <span class='kw'>def</span> <span class='id identifier rubyid_preview_session'>preview_session</span><span class='lparen'>(</span><span class='id identifier rubyid_token'>token</span><span class='comma'>,</span> <span class='id identifier rubyid_link_resolver'>link_resolver</span><span class='comma'>,</span> <span class='id identifier rubyid_default_url'>default_url</span><span class='rparen'>)</span>
2805
+ <span class='id identifier rubyid_response'>response</span> <span class='op'>=</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_http_client'>http_client</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='id identifier rubyid_token'>token</span><span class='comma'>,</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Accept</span><span class='tstring_end'>&#39;</span></span> <span class='op'>=&gt;</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>application/json</span><span class='tstring_end'>&#39;</span></span><span class='rparen'>)</span>
2806
+ <span class='kw'>if</span> <span class='id identifier rubyid_response'>response</span><span class='period'>.</span><span class='id identifier rubyid_code'>code</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span> <span class='op'>!=</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>200</span><span class='tstring_end'>&#39;</span></span>
2807
+ <span class='kw'>return</span> <span class='id identifier rubyid_default_url'>default_url</span>
2808
+ <span class='kw'>end</span>
2809
+ <span class='id identifier rubyid_json'>json</span> <span class='op'>=</span> <span class='const'>JSON</span><span class='period'>.</span><span class='id identifier rubyid_load'>load</span><span class='lparen'>(</span><span class='id identifier rubyid_response'>response</span><span class='period'>.</span><span class='id identifier rubyid_body'>body</span><span class='rparen'>)</span>
2810
+ <span class='id identifier rubyid_documents'>documents</span> <span class='op'>=</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_form'>form</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>everything</span><span class='tstring_end'>&#39;</span></span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_query'>query</span><span class='lparen'>(</span><span class='const'>Prismic</span><span class='op'>::</span><span class='const'>Predicates</span><span class='period'>.</span><span class='id identifier rubyid_at'>at</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>document.id</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span> <span class='id identifier rubyid_json'>json</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>mainDocument</span><span class='tstring_end'>&#39;</span></span><span class='rbracket'>]</span><span class='rparen'>)</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_submit'>submit</span><span class='lparen'>(</span><span class='id identifier rubyid_token'>token</span><span class='rparen'>)</span>
2811
+ <span class='kw'>if</span> <span class='id identifier rubyid_documents'>documents</span><span class='period'>.</span><span class='id identifier rubyid_results'>results</span><span class='period'>.</span><span class='id identifier rubyid_size'>size</span> <span class='op'>&gt;</span> <span class='int'>0</span>
2812
+ <span class='id identifier rubyid_link_resolver'>link_resolver</span><span class='period'>.</span><span class='id identifier rubyid_link_to'>link_to</span><span class='lparen'>(</span><span class='id identifier rubyid_documents'>documents</span><span class='period'>.</span><span class='id identifier rubyid_results'>results</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</span><span class='rparen'>)</span>
2813
+ <span class='kw'>else</span>
2814
+ <span class='id identifier rubyid_default_url'>default_url</span>
2815
+ <span class='kw'>end</span>
2816
+ <span class='kw'>end</span></pre>
2817
+ </td>
2818
+ </tr>
2819
+ </table>
2820
+ </div>
2821
+
2822
+ <div class="method_details ">
2823
+ <h3 class="signature " id="query-instance_method">
2824
+
2825
+ - (<tt>Object</tt>) <strong>query</strong>(q, data = {})
2826
+
2827
+
2828
+
2829
+
2830
+
2831
+ </h3><div class="docstring">
2832
+ <div class="discussion">
2833
+ <p>Perform a query on this API. Use the master reference is no ref is specified in data.</p>
2834
+
2835
+
2836
+ </div>
2837
+ </div>
2838
+ <div class="tags">
2839
+ <p class="tag_title">Parameters:</p>
2840
+ <ul class="param">
2841
+
2842
+ <li>
2843
+
2844
+ <span class='name'>q</span>
2845
+
2846
+
2847
+ <span class='type'>(<tt>String</tt>)</span>
2848
+
2849
+
2850
+
2851
+ &mdash;
2852
+ <div class='inline'><p>the query to perform</p>
2853
+ </div>
2854
+
2855
+ </li>
2856
+
2857
+ <li>
2858
+
2859
+ <span class='name'>data</span>
2860
+
2861
+
2862
+ <span class='type'>(<tt>Hash</tt>)</span>
2863
+
2864
+
2865
+ <em class="default">(defaults to: <tt>{}</tt>)</em>
2866
+
2867
+
2868
+ &mdash;
2869
+ <div class='inline'><p>query options (page, pageSize, ref, etc.)</p>
2870
+ </div>
2871
+
2872
+ </li>
2873
+
2874
+ </ul>
2875
+
2876
+
2877
+ </div><table class="source_code">
2878
+ <tr>
2879
+ <td>
2880
+ <pre class="lines">
2881
+
2882
+
2883
+ 89
2884
+ 90
2885
+ 91
2886
+ 92</pre>
2887
+ </td>
2888
+ <td>
2889
+ <pre class="code"><span class="info file"># File 'lib/prismic/api.rb', line 89</span>
2890
+
2891
+ <span class='kw'>def</span> <span class='id identifier rubyid_query'>query</span><span class='lparen'>(</span><span class='id identifier rubyid_q'>q</span><span class='comma'>,</span> <span class='id identifier rubyid_data'>data</span><span class='op'>=</span><span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
2892
+ <span class='id identifier rubyid_ref'>ref</span> <span class='op'>=</span> <span class='id identifier rubyid_data'>data</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>ref</span><span class='tstring_end'>&#39;</span></span><span class='rbracket'>]</span> <span class='op'>||</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_master'>master</span><span class='period'>.</span><span class='id identifier rubyid_ref'>ref</span>
2893
+ <span class='id identifier rubyid_form'>form</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>everything</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span> <span class='id identifier rubyid_data'>data</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_query'>query</span><span class='lparen'>(</span><span class='id identifier rubyid_q'>q</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_submit'>submit</span><span class='lparen'>(</span><span class='id identifier rubyid_ref'>ref</span><span class='rparen'>)</span>
2894
+ <span class='kw'>end</span></pre>
2895
+ </td>
2896
+ </tr>
2897
+ </table>
2898
+ </div>
2899
+
2900
+ <div class="method_details ">
2901
+ <h3 class="signature " id="ref-instance_method">
2902
+
2903
+ - (<tt><span class='object_link'><a href="Ref.html" title="Prismic::Ref (class)">Ref</a></span></tt>) <strong>ref</strong>(name)
2904
+
2905
+
2906
+
2907
+
2908
+
2909
+ </h3><div class="docstring">
2910
+ <div class="discussion">
2911
+ <p>Get a <span class='object_link'><a href="Ref.html" title="Prismic::Ref (class)">reference</a></span> by its alias</p>
2912
+
2913
+
2914
+ </div>
2915
+ </div>
2916
+ <div class="tags">
2917
+ <p class="tag_title">Parameters:</p>
2918
+ <ul class="param">
2919
+
2920
+ <li>
2921
+
2922
+ <span class='name'>name</span>
2923
+
2924
+
2925
+ <span class='type'>(<tt>String</tt>)</span>
2926
+
2927
+
2928
+
2929
+ &mdash;
2930
+ <div class='inline'><p>The reference&#39;s alias</p>
2931
+ </div>
2932
+
2933
+ </li>
2934
+
2935
+ </ul>
2936
+
2937
+ <p class="tag_title">Returns:</p>
2938
+ <ul class="return">
2939
+
2940
+ <li>
2941
+
2942
+
2943
+ <span class='type'>(<tt><span class='object_link'><a href="Ref.html" title="Prismic::Ref (class)">Ref</a></span></tt>)</span>
2944
+
2945
+
2946
+
2947
+ &mdash;
2948
+ <div class='inline'><p>The reference</p>
2949
+ </div>
2950
+
2951
+ </li>
2952
+
2953
+ </ul>
2954
+
2955
+ </div><table class="source_code">
2956
+ <tr>
2957
+ <td>
2958
+ <pre class="lines">
2959
+
2960
+
2961
+ 61
2962
+ 62
2963
+ 63</pre>
2964
+ </td>
2965
+ <td>
2966
+ <pre class="code"><span class="info file"># File 'lib/prismic/api.rb', line 61</span>
2967
+
2968
+ <span class='kw'>def</span> <span class='id identifier rubyid_ref'>ref</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='rparen'>)</span>
2969
+ <span class='id identifier rubyid_refs'>refs</span><span class='lbracket'>[</span><span class='id identifier rubyid_name'>name</span><span class='period'>.</span><span class='id identifier rubyid_downcase'>downcase</span><span class='rbracket'>]</span>
2970
+ <span class='kw'>end</span></pre>
2971
+ </td>
2972
+ </tr>
2973
+ </table>
2974
+ </div>
2975
+
2976
+ </div>
2977
+
2978
+ </div>
2979
+
2980
+ <div id="footer">
2981
+ Generated on Tue Sep 27 10:47:06 2016 by
2982
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
2983
+ 0.8.7.4 (ruby-2.0.0).
2984
+ </div>
2985
+
2986
+ </body>
2987
+ </html>