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,2172 @@
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::SearchForm
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/SearchForm.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 (S)</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">SearchForm</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::SearchForm
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::SearchForm</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.rb</dd>
98
+
99
+ </dl>
100
+ <div class="clear"></div>
101
+
102
+ <h2>Overview</h2><div class="docstring">
103
+ <div class="discussion">
104
+ <p>A SearchForm represent a Form returned by the prismic.io API.</p>
105
+
106
+ <p>These forms depend on the prismic.io repository, and can be filled and sent
107
+ as regular HTML forms.</p>
108
+
109
+ <p>You may get a SearchForm instance through the <span class='object_link'><a href="API.html#form-instance_method" title="Prismic::API#form (method)">API#form</a></span> method.</p>
110
+
111
+ <p>The SearchForm instance contains helper methods for each predefined form&#39;s fields.
112
+ Note that these methods are not created if they risk to add confusion:</p>
113
+
114
+ <ul>
115
+ <li>only letters, underscore and digits are authorized in the name</li>
116
+ <li>name starting with a digit or an underscore are forbidden</li>
117
+ <li>generated method can&#39;t override existing methods</li>
118
+ </ul>
119
+
120
+
121
+ </div>
122
+ </div>
123
+ <div class="tags">
124
+
125
+ <div class="examples">
126
+ <p class="tag_title">Examples:</p>
127
+
128
+
129
+ <pre class="example code"><code><span class='id identifier rubyid_search_form'>search_form</span> <span class='op'>=</span> <span class='id identifier rubyid_api'>api</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>
130
+ <span class='id identifier rubyid_search_form'>search_form</span><span class='period'>.</span><span class='id identifier rubyid_page'>page</span><span class='lparen'>(</span><span class='int'>3</span><span class='rparen'>)</span> <span class='comment'># specify the field &#39;page&#39;
131
+ </span><span class='id identifier rubyid_search_form'>search_form</span><span class='period'>.</span><span class='id identifier rubyid_page_size'>page_size</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>20</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span> <span class='comment'># specify the &#39;page_size&#39; field
132
+ </span><span class='id identifier rubyid_results'>results</span> <span class='op'>=</span> <span class='id identifier rubyid_search_form'>search_form</span><span class='period'>.</span><span class='id identifier rubyid_submit'>submit</span><span class='lparen'>(</span><span class='id identifier rubyid_master_ref'>master_ref</span><span class='rparen'>)</span> <span class='comment'># submit the search form
133
+ </span><span class='id identifier rubyid_results'>results</span> <span class='op'>=</span> <span class='id identifier rubyid_api'>api</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_page'>page</span><span class='lparen'>(</span><span class='int'>3</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_page_size'>page_size</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>20</span><span class='tstring_end'>&quot;</span></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_master_ref'>master_ref</span><span class='rparen'>)</span> <span class='comment'># methods can be chained</span></code></pre>
134
+
135
+ </div>
136
+
137
+
138
+ </div><h2>Defined Under Namespace</h2>
139
+ <p class="children">
140
+
141
+
142
+
143
+
144
+ <strong class="classes">Classes:</strong> <span class='object_link'><a href="SearchForm/AuthenticationException.html" title="Prismic::SearchForm::AuthenticationException (class)">AuthenticationException</a></span>, <span class='object_link'><a href="SearchForm/AuthorizationException.html" title="Prismic::SearchForm::AuthorizationException (class)">AuthorizationException</a></span>, <span class='object_link'><a href="SearchForm/FormSearchException.html" title="Prismic::SearchForm::FormSearchException (class)">FormSearchException</a></span>, <span class='object_link'><a href="SearchForm/NoRefSetException.html" title="Prismic::SearchForm::NoRefSetException (class)">NoRefSetException</a></span>, <span class='object_link'><a href="SearchForm/RefNotFoundException.html" title="Prismic::SearchForm::RefNotFoundException (class)">RefNotFoundException</a></span>, <span class='object_link'><a href="SearchForm/UnsupportedFormKind.html" title="Prismic::SearchForm::UnsupportedFormKind (class)">UnsupportedFormKind</a></span>
145
+
146
+
147
+ </p>
148
+
149
+
150
+
151
+
152
+ <h2>Instance Attribute Summary <small>(<a href="#" class="summary_toggle">collapse</a>)</small></h2>
153
+ <ul class="summary">
154
+
155
+ <li class="public ">
156
+ <span class="summary_signature">
157
+
158
+ <a href="#api-instance_method" title="#api (instance method)">- (Object) <strong>api</strong> </a>
159
+
160
+
161
+
162
+ </span>
163
+
164
+
165
+
166
+
167
+
168
+
169
+
170
+
171
+
172
+
173
+
174
+
175
+ <span class="summary_desc"><div class='inline'><p>Returns the value of attribute api.</p>
176
+ </div></span>
177
+
178
+ </li>
179
+
180
+
181
+ <li class="public ">
182
+ <span class="summary_signature">
183
+
184
+ <a href="#data-instance_method" title="#data (instance method)">- (Object) <strong>data</strong> </a>
185
+
186
+
187
+
188
+ </span>
189
+
190
+
191
+
192
+
193
+
194
+
195
+
196
+
197
+
198
+
199
+
200
+
201
+ <span class="summary_desc"><div class='inline'><p>Returns the value of attribute data.</p>
202
+ </div></span>
203
+
204
+ </li>
205
+
206
+
207
+ <li class="public ">
208
+ <span class="summary_signature">
209
+
210
+ <a href="#form-instance_method" title="#form (instance method)">- (Object) <strong>form</strong> </a>
211
+
212
+
213
+
214
+ </span>
215
+
216
+
217
+
218
+
219
+
220
+
221
+
222
+
223
+
224
+
225
+
226
+
227
+ <span class="summary_desc"><div class='inline'><p>Returns the value of attribute form.</p>
228
+ </div></span>
229
+
230
+ </li>
231
+
232
+
233
+ <li class="public ">
234
+ <span class="summary_signature">
235
+
236
+ <a href="#ref-instance_method" title="#ref (instance method)">- (SearchForm) <strong>ref</strong>(ref) </a>
237
+
238
+
239
+
240
+ </span>
241
+
242
+
243
+
244
+
245
+
246
+
247
+
248
+
249
+
250
+
251
+
252
+
253
+ <span class="summary_desc"><div class='inline'><p>Set the <span class='object_link'><a href="Ref.html" title="Prismic::Ref (class)">reference</a></span> to use.</p>
254
+ </div></span>
255
+
256
+ </li>
257
+
258
+
259
+ </ul>
260
+
261
+
262
+
263
+
264
+
265
+ <h2>
266
+ Instance Method Summary
267
+ <small>(<a href="#" class="summary_toggle">collapse</a>)</small>
268
+ </h2>
269
+
270
+ <ul class="summary">
271
+
272
+ <li class="public ">
273
+ <span class="summary_signature">
274
+
275
+ <a href="#fetch-instance_method" title="#fetch (instance method)">- (SearchForm) <strong>fetch</strong>(fields) </a>
276
+
277
+
278
+
279
+ </span>
280
+
281
+
282
+
283
+
284
+
285
+
286
+
287
+
288
+
289
+ <span class="summary_desc"><div class='inline'><p>Restrict the document fragments to the specified fields.</p>
290
+ </div></span>
291
+
292
+ </li>
293
+
294
+
295
+ <li class="public ">
296
+ <span class="summary_signature">
297
+
298
+ <a href="#fetch_links-instance_method" title="#fetch_links (instance method)">- (SearchForm) <strong>fetch_links</strong>(fields) </a>
299
+
300
+
301
+
302
+ </span>
303
+
304
+
305
+
306
+
307
+
308
+
309
+
310
+
311
+
312
+ <span class="summary_desc"><div class='inline'><p>Include the document fragments correspondong to the specified fields for DocumentLink.</p>
313
+ </div></span>
314
+
315
+ </li>
316
+
317
+
318
+ <li class="public ">
319
+ <span class="summary_signature">
320
+
321
+ <a href="#form_action-instance_method" title="#form_action (instance method)">- (String) <strong>form_action</strong> </a>
322
+
323
+
324
+
325
+ </span>
326
+
327
+
328
+
329
+
330
+
331
+
332
+
333
+
334
+
335
+ <span class="summary_desc"><div class='inline'><p>Returns the form&#39;s action (URL).</p>
336
+ </div></span>
337
+
338
+ </li>
339
+
340
+
341
+ <li class="public ">
342
+ <span class="summary_signature">
343
+
344
+ <a href="#form_enctype-instance_method" title="#form_enctype (instance method)">- (String) <strong>form_enctype</strong> </a>
345
+
346
+
347
+
348
+ </span>
349
+
350
+
351
+
352
+
353
+
354
+
355
+
356
+
357
+
358
+ <span class="summary_desc"><div class='inline'><p>Returns the form&#39;s encoding type.</p>
359
+ </div></span>
360
+
361
+ </li>
362
+
363
+
364
+ <li class="public ">
365
+ <span class="summary_signature">
366
+
367
+ <a href="#form_fields-instance_method" title="#form_fields (instance method)">- (String) <strong>form_fields</strong> </a>
368
+
369
+
370
+
371
+ </span>
372
+
373
+
374
+
375
+
376
+
377
+
378
+
379
+
380
+
381
+ <span class="summary_desc"><div class='inline'><p>Returns the form&#39;s fields.</p>
382
+ </div></span>
383
+
384
+ </li>
385
+
386
+
387
+ <li class="public ">
388
+ <span class="summary_signature">
389
+
390
+ <a href="#form_method-instance_method" title="#form_method (instance method)">- (String) <strong>form_method</strong> </a>
391
+
392
+
393
+
394
+ </span>
395
+
396
+
397
+
398
+
399
+
400
+
401
+
402
+
403
+
404
+ <span class="summary_desc"><div class='inline'><p>Returns the form&#39;s HTTP method.</p>
405
+ </div></span>
406
+
407
+ </li>
408
+
409
+
410
+ <li class="public ">
411
+ <span class="summary_signature">
412
+
413
+ <a href="#form_name-instance_method" title="#form_name (instance method)">- (String) <strong>form_name</strong> </a>
414
+
415
+
416
+
417
+ </span>
418
+
419
+
420
+
421
+
422
+
423
+
424
+
425
+
426
+
427
+ <span class="summary_desc"><div class='inline'><p>Returns the form&#39;s name.</p>
428
+ </div></span>
429
+
430
+ </li>
431
+
432
+
433
+ <li class="public ">
434
+ <span class="summary_signature">
435
+
436
+ <a href="#form_rel-instance_method" title="#form_rel (instance method)">- (String) <strong>form_rel</strong> </a>
437
+
438
+
439
+
440
+ </span>
441
+
442
+
443
+
444
+
445
+
446
+
447
+
448
+
449
+
450
+ <span class="summary_desc"><div class='inline'><p>Returns the form&#39;s relationship.</p>
451
+ </div></span>
452
+
453
+ </li>
454
+
455
+
456
+ <li class="public ">
457
+ <span class="summary_signature">
458
+
459
+ <a href="#initialize-instance_method" title="#initialize (instance method)">- (SearchForm) <strong>initialize</strong>(api, form, data = {}, ref = nil) </a>
460
+
461
+
462
+
463
+ </span>
464
+
465
+
466
+ <span class="note title constructor">constructor</span>
467
+
468
+
469
+
470
+
471
+
472
+
473
+
474
+
475
+ <span class="summary_desc"><div class='inline'><p>A new instance of SearchForm.</p>
476
+ </div></span>
477
+
478
+ </li>
479
+
480
+
481
+ <li class="public ">
482
+ <span class="summary_signature">
483
+
484
+ <a href="#orderings-instance_method" title="#orderings (instance method)">- (SearchForm) <strong>orderings</strong>(orderings) </a>
485
+
486
+
487
+
488
+ </span>
489
+
490
+
491
+
492
+
493
+
494
+
495
+
496
+
497
+
498
+ <span class="summary_desc"><div class='inline'><p>Specify a orderings for this form.</p>
499
+ </div></span>
500
+
501
+ </li>
502
+
503
+
504
+ <li class="public ">
505
+ <span class="summary_signature">
506
+
507
+ <a href="#page-instance_method" title="#page (instance method)">- (SearchForm) <strong>page</strong>(page) </a>
508
+
509
+
510
+
511
+ </span>
512
+
513
+
514
+
515
+
516
+
517
+
518
+
519
+
520
+
521
+ <span class="summary_desc"><div class='inline'><p>Specify a page for this form.</p>
522
+ </div></span>
523
+
524
+ </li>
525
+
526
+
527
+ <li class="public ">
528
+ <span class="summary_signature">
529
+
530
+ <a href="#page_size-instance_method" title="#page_size (instance method)">- (SearchForm) <strong>page_size</strong>(page_size) </a>
531
+
532
+
533
+
534
+ </span>
535
+
536
+
537
+
538
+
539
+
540
+
541
+
542
+
543
+
544
+ <span class="summary_desc"><div class='inline'><p>Specify a page size for this form.</p>
545
+ </div></span>
546
+
547
+ </li>
548
+
549
+
550
+ <li class="public ">
551
+ <span class="summary_signature">
552
+
553
+ <a href="#q-instance_method" title="#q (instance method)">- (Object) <strong>q</strong>(*query) </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="#query-instance_method" title="#query (instance method)">- (Object) <strong>query</strong>(*query) </a>
576
+
577
+
578
+
579
+ </span>
580
+
581
+
582
+
583
+
584
+
585
+
586
+
587
+
588
+
589
+ <span class="summary_desc"><div class='inline'><p>Specify a query for this form.</p>
590
+ </div></span>
591
+
592
+ </li>
593
+
594
+
595
+ <li class="public ">
596
+ <span class="summary_signature">
597
+
598
+ <a href="#serialize-instance_method" title="#serialize (instance method)">- (Object) <strong>serialize</strong>(field) </a>
599
+
600
+
601
+
602
+ </span>
603
+
604
+
605
+
606
+
607
+
608
+
609
+
610
+
611
+
612
+ <span class="summary_desc"><div class='inline'></div></span>
613
+
614
+ </li>
615
+
616
+
617
+ <li class="public ">
618
+ <span class="summary_signature">
619
+
620
+ <a href="#set-instance_method" title="#set (instance method)">- (SearchForm) <strong>set</strong>(field_name, value) </a>
621
+
622
+
623
+
624
+ </span>
625
+
626
+
627
+
628
+
629
+
630
+
631
+
632
+
633
+
634
+ <span class="summary_desc"><div class='inline'><p>Specify a parameter for this form.</p>
635
+ </div></span>
636
+
637
+ </li>
638
+
639
+
640
+ <li class="public ">
641
+ <span class="summary_signature">
642
+
643
+ <a href="#submit-instance_method" title="#submit (instance method)">- (Response) <strong>submit</strong>(ref = nil) </a>
644
+
645
+
646
+
647
+ </span>
648
+
649
+
650
+
651
+
652
+
653
+
654
+
655
+
656
+
657
+ <span class="summary_desc"><div class='inline'><p>Submit the form.</p>
658
+ </div></span>
659
+
660
+ </li>
661
+
662
+
663
+ <li class="public ">
664
+ <span class="summary_signature">
665
+
666
+ <a href="#submit_raw-instance_method" title="#submit_raw (instance method)">- (string) <strong>submit_raw</strong>(ref = nil) </a>
667
+
668
+
669
+
670
+ </span>
671
+
672
+
673
+
674
+
675
+
676
+
677
+
678
+
679
+
680
+ <span class="summary_desc"><div class='inline'><p>Submit the form, returns a raw JSON string.</p>
681
+ </div></span>
682
+
683
+ </li>
684
+
685
+
686
+ </ul>
687
+
688
+
689
+ <div id="constructor_details" class="method_details_list">
690
+ <h2>Constructor Details</h2>
691
+
692
+ <div class="method_details first">
693
+ <h3 class="signature first" id="initialize-instance_method">
694
+
695
+ - (<tt><span class='object_link'><a href="" title="Prismic::SearchForm (class)">SearchForm</a></span></tt>) <strong>initialize</strong>(api, form, data = {}, ref = nil)
696
+
697
+
698
+
699
+
700
+
701
+ </h3><div class="docstring">
702
+ <div class="discussion">
703
+ <p>Returns a new instance of SearchForm</p>
704
+
705
+
706
+ </div>
707
+ </div>
708
+ <div class="tags">
709
+
710
+
711
+ </div><table class="source_code">
712
+ <tr>
713
+ <td>
714
+ <pre class="lines">
715
+
716
+
717
+ 144
718
+ 145
719
+ 146
720
+ 147
721
+ 148
722
+ 149
723
+ 150
724
+ 151
725
+ 152</pre>
726
+ </td>
727
+ <td>
728
+ <pre class="code"><span class="info file"># File 'lib/prismic.rb', line 144</span>
729
+
730
+ <span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</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='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='kw'>nil</span><span class='rparen'>)</span>
731
+ <span class='ivar'>@api</span> <span class='op'>=</span> <span class='id identifier rubyid_api'>api</span>
732
+ <span class='ivar'>@form</span> <span class='op'>=</span> <span class='id identifier rubyid_form'>form</span>
733
+ <span class='ivar'>@data</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
734
+ <span class='id identifier rubyid_form'>form</span><span class='period'>.</span><span class='id identifier rubyid_fields'>fields</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_name'>name</span><span class='comma'>,</span> <span class='id identifier rubyid__'>_</span><span class='op'>|</span> <span class='id identifier rubyid_create_field_helper_method'>create_field_helper_method</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='rparen'>)</span> <span class='rbrace'>}</span>
735
+ <span class='id identifier rubyid_form'>form</span><span class='period'>.</span><span class='id identifier rubyid_default_data'>default_data</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_key'>key</span><span class='comma'>,</span> <span class='id identifier rubyid_value'>value</span><span class='op'>|</span> <span class='id identifier rubyid_set'>set</span><span class='lparen'>(</span><span class='id identifier rubyid_key'>key</span><span class='comma'>,</span> <span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span> <span class='rbrace'>}</span>
736
+ <span class='id identifier rubyid_data'>data</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_key'>key</span><span class='comma'>,</span> <span class='id identifier rubyid_value'>value</span><span class='op'>|</span> <span class='id identifier rubyid_set'>set</span><span class='lparen'>(</span><span class='id identifier rubyid_key'>key</span><span class='comma'>,</span> <span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span> <span class='rbrace'>}</span>
737
+ <span class='ivar'>@ref</span> <span class='op'>=</span> <span class='id identifier rubyid_ref'>ref</span>
738
+ <span class='kw'>end</span></pre>
739
+ </td>
740
+ </tr>
741
+ </table>
742
+ </div>
743
+
744
+ </div>
745
+
746
+ <div id="instance_attr_details" class="attr_details">
747
+ <h2>Instance Attribute Details</h2>
748
+
749
+
750
+ <span id="api=-instance_method"></span>
751
+ <div class="method_details first">
752
+ <h3 class="signature first" id="api-instance_method">
753
+
754
+ - (<tt>Object</tt>) <strong>api</strong>
755
+
756
+
757
+
758
+
759
+
760
+ </h3><div class="docstring">
761
+ <div class="discussion">
762
+ <p>Returns the value of attribute api</p>
763
+
764
+
765
+ </div>
766
+ </div>
767
+ <div class="tags">
768
+
769
+
770
+ </div><table class="source_code">
771
+ <tr>
772
+ <td>
773
+ <pre class="lines">
774
+
775
+
776
+ 142
777
+ 143
778
+ 144</pre>
779
+ </td>
780
+ <td>
781
+ <pre class="code"><span class="info file"># File 'lib/prismic.rb', line 142</span>
782
+
783
+ <span class='kw'>def</span> <span class='id identifier rubyid_api'>api</span>
784
+ <span class='ivar'>@api</span>
785
+ <span class='kw'>end</span></pre>
786
+ </td>
787
+ </tr>
788
+ </table>
789
+ </div>
790
+
791
+
792
+ <span id="data=-instance_method"></span>
793
+ <div class="method_details ">
794
+ <h3 class="signature " id="data-instance_method">
795
+
796
+ - (<tt>Object</tt>) <strong>data</strong>
797
+
798
+
799
+
800
+
801
+
802
+ </h3><div class="docstring">
803
+ <div class="discussion">
804
+ <p>Returns the value of attribute data</p>
805
+
806
+
807
+ </div>
808
+ </div>
809
+ <div class="tags">
810
+
811
+
812
+ </div><table class="source_code">
813
+ <tr>
814
+ <td>
815
+ <pre class="lines">
816
+
817
+
818
+ 142
819
+ 143
820
+ 144</pre>
821
+ </td>
822
+ <td>
823
+ <pre class="code"><span class="info file"># File 'lib/prismic.rb', line 142</span>
824
+
825
+ <span class='kw'>def</span> <span class='id identifier rubyid_data'>data</span>
826
+ <span class='ivar'>@data</span>
827
+ <span class='kw'>end</span></pre>
828
+ </td>
829
+ </tr>
830
+ </table>
831
+ </div>
832
+
833
+
834
+ <span id="form=-instance_method"></span>
835
+ <div class="method_details ">
836
+ <h3 class="signature " id="form-instance_method">
837
+
838
+ - (<tt>Object</tt>) <strong>form</strong>
839
+
840
+
841
+
842
+
843
+
844
+ </h3><div class="docstring">
845
+ <div class="discussion">
846
+ <p>Returns the value of attribute form</p>
847
+
848
+
849
+ </div>
850
+ </div>
851
+ <div class="tags">
852
+
853
+
854
+ </div><table class="source_code">
855
+ <tr>
856
+ <td>
857
+ <pre class="lines">
858
+
859
+
860
+ 142
861
+ 143
862
+ 144</pre>
863
+ </td>
864
+ <td>
865
+ <pre class="code"><span class="info file"># File 'lib/prismic.rb', line 142</span>
866
+
867
+ <span class='kw'>def</span> <span class='id identifier rubyid_form'>form</span>
868
+ <span class='ivar'>@form</span>
869
+ <span class='kw'>end</span></pre>
870
+ </td>
871
+ </tr>
872
+ </table>
873
+ </div>
874
+
875
+
876
+ <span id="ref=-instance_method"></span>
877
+ <div class="method_details ">
878
+ <h3 class="signature " id="ref-instance_method">
879
+
880
+ - (<tt><span class='object_link'><a href="" title="Prismic::SearchForm (class)">SearchForm</a></span></tt>) <strong>ref</strong>(ref)
881
+
882
+
883
+
884
+
885
+
886
+ </h3><div class="docstring">
887
+ <div class="discussion">
888
+ <p>Set the <span class='object_link'><a href="Ref.html" title="Prismic::Ref (class)">reference</a></span> to use</p>
889
+
890
+
891
+ </div>
892
+ </div>
893
+ <div class="tags">
894
+ <p class="tag_title">Parameters:</p>
895
+ <ul class="param">
896
+
897
+ <li>
898
+
899
+ <span class='name'>ref</span>
900
+
901
+
902
+ <span class='type'>(<tt><span class='object_link'><a href="Ref.html" title="Prismic::Ref (class)">Ref</a></span></tt>, <tt>String</tt>)</span>
903
+
904
+
905
+
906
+ &mdash;
907
+ <div class='inline'><p>The <span class='object_link'><a href="Ref.html" title="Prismic::Ref (class)">reference</a></span> to use</p>
908
+ </div>
909
+
910
+ </li>
911
+
912
+ </ul>
913
+
914
+ <p class="tag_title">Returns:</p>
915
+ <ul class="return">
916
+
917
+ <li>
918
+
919
+
920
+ <span class='type'>(<tt><span class='object_link'><a href="" title="Prismic::SearchForm (class)">SearchForm</a></span></tt>)</span>
921
+
922
+
923
+
924
+ &mdash;
925
+ <div class='inline'><p>self</p>
926
+ </div>
927
+
928
+ </li>
929
+
930
+ </ul>
931
+
932
+ </div><table class="source_code">
933
+ <tr>
934
+ <td>
935
+ <pre class="lines">
936
+
937
+
938
+ 351
939
+ 352
940
+ 353</pre>
941
+ </td>
942
+ <td>
943
+ <pre class="code"><span class="info file"># File 'lib/prismic.rb', line 351</span>
944
+
945
+ <span class='kw'>def</span> <span class='id identifier rubyid_ref'>ref</span>
946
+ <span class='ivar'>@ref</span>
947
+ <span class='kw'>end</span></pre>
948
+ </td>
949
+ </tr>
950
+ </table>
951
+ </div>
952
+
953
+ </div>
954
+
955
+
956
+ <div id="instance_method_details" class="method_details_list">
957
+ <h2>Instance Method Details</h2>
958
+
959
+
960
+ <div class="method_details first">
961
+ <h3 class="signature first" id="fetch-instance_method">
962
+
963
+ - (<tt><span class='object_link'><a href="" title="Prismic::SearchForm (class)">SearchForm</a></span></tt>) <strong>fetch</strong>(fields)
964
+
965
+
966
+
967
+
968
+
969
+ </h3><div class="docstring">
970
+ <div class="discussion">
971
+ <p>Restrict the document fragments to the specified fields</p>
972
+
973
+
974
+ </div>
975
+ </div>
976
+ <div class="tags">
977
+ <p class="tag_title">Parameters:</p>
978
+ <ul class="param">
979
+
980
+ <li>
981
+
982
+ <span class='name'>fields</span>
983
+
984
+
985
+ <span class='type'>(<tt>String</tt>)</span>
986
+
987
+
988
+
989
+ &mdash;
990
+ <div class='inline'><p>The fields separated by commas (,)</p>
991
+ </div>
992
+
993
+ </li>
994
+
995
+ </ul>
996
+
997
+ <p class="tag_title">Returns:</p>
998
+ <ul class="return">
999
+
1000
+ <li>
1001
+
1002
+
1003
+ <span class='type'>(<tt><span class='object_link'><a href="" title="Prismic::SearchForm (class)">SearchForm</a></span></tt>)</span>
1004
+
1005
+
1006
+
1007
+ &mdash;
1008
+ <div class='inline'><p>self</p>
1009
+ </div>
1010
+
1011
+ </li>
1012
+
1013
+ </ul>
1014
+
1015
+ </div><table class="source_code">
1016
+ <tr>
1017
+ <td>
1018
+ <pre class="lines">
1019
+
1020
+
1021
+ </pre>
1022
+ </td>
1023
+ <td>
1024
+ <pre class="code"><span class="info file"># File 'lib/prismic.rb', line 197</span>
1025
+
1026
+ </pre>
1027
+ </td>
1028
+ </tr>
1029
+ </table>
1030
+ </div>
1031
+
1032
+ <div class="method_details ">
1033
+ <h3 class="signature " id="fetch_links-instance_method">
1034
+
1035
+ - (<tt><span class='object_link'><a href="" title="Prismic::SearchForm (class)">SearchForm</a></span></tt>) <strong>fetch_links</strong>(fields)
1036
+
1037
+
1038
+
1039
+
1040
+
1041
+ </h3><div class="docstring">
1042
+ <div class="discussion">
1043
+ <p>Include the document fragments correspondong to the specified fields for DocumentLink</p>
1044
+
1045
+
1046
+ </div>
1047
+ </div>
1048
+ <div class="tags">
1049
+ <p class="tag_title">Parameters:</p>
1050
+ <ul class="param">
1051
+
1052
+ <li>
1053
+
1054
+ <span class='name'>fields</span>
1055
+
1056
+
1057
+ <span class='type'>(<tt>String</tt>)</span>
1058
+
1059
+
1060
+
1061
+ &mdash;
1062
+ <div class='inline'><p>The fields separated by commas (,)</p>
1063
+ </div>
1064
+
1065
+ </li>
1066
+
1067
+ </ul>
1068
+
1069
+ <p class="tag_title">Returns:</p>
1070
+ <ul class="return">
1071
+
1072
+ <li>
1073
+
1074
+
1075
+ <span class='type'>(<tt><span class='object_link'><a href="" title="Prismic::SearchForm (class)">SearchForm</a></span></tt>)</span>
1076
+
1077
+
1078
+
1079
+ &mdash;
1080
+ <div class='inline'><p>self</p>
1081
+ </div>
1082
+
1083
+ </li>
1084
+
1085
+ </ul>
1086
+
1087
+ </div><table class="source_code">
1088
+ <tr>
1089
+ <td>
1090
+ <pre class="lines">
1091
+
1092
+
1093
+ </pre>
1094
+ </td>
1095
+ <td>
1096
+ <pre class="code"><span class="info file"># File 'lib/prismic.rb', line 202</span>
1097
+
1098
+ </pre>
1099
+ </td>
1100
+ </tr>
1101
+ </table>
1102
+ </div>
1103
+
1104
+ <div class="method_details ">
1105
+ <h3 class="signature " id="form_action-instance_method">
1106
+
1107
+ - (<tt>String</tt>) <strong>form_action</strong>
1108
+
1109
+
1110
+
1111
+
1112
+
1113
+ </h3><div class="docstring">
1114
+ <div class="discussion">
1115
+ <p>Returns the form&#39;s action (URL)</p>
1116
+
1117
+
1118
+ </div>
1119
+ </div>
1120
+ <div class="tags">
1121
+
1122
+ <p class="tag_title">Returns:</p>
1123
+ <ul class="return">
1124
+
1125
+ <li>
1126
+
1127
+
1128
+ <span class='type'>(<tt>String</tt>)</span>
1129
+
1130
+
1131
+
1132
+ </li>
1133
+
1134
+ </ul>
1135
+
1136
+ </div><table class="source_code">
1137
+ <tr>
1138
+ <td>
1139
+ <pre class="lines">
1140
+
1141
+
1142
+ 248
1143
+ 249
1144
+ 250</pre>
1145
+ </td>
1146
+ <td>
1147
+ <pre class="code"><span class="info file"># File 'lib/prismic.rb', line 248</span>
1148
+
1149
+ <span class='kw'>def</span> <span class='id identifier rubyid_form_action'>form_action</span>
1150
+ <span class='id identifier rubyid_form'>form</span><span class='period'>.</span><span class='id identifier rubyid_action'>action</span>
1151
+ <span class='kw'>end</span></pre>
1152
+ </td>
1153
+ </tr>
1154
+ </table>
1155
+ </div>
1156
+
1157
+ <div class="method_details ">
1158
+ <h3 class="signature " id="form_enctype-instance_method">
1159
+
1160
+ - (<tt>String</tt>) <strong>form_enctype</strong>
1161
+
1162
+
1163
+
1164
+
1165
+
1166
+ </h3><div class="docstring">
1167
+ <div class="discussion">
1168
+ <p>Returns the form&#39;s encoding type</p>
1169
+
1170
+
1171
+ </div>
1172
+ </div>
1173
+ <div class="tags">
1174
+
1175
+ <p class="tag_title">Returns:</p>
1176
+ <ul class="return">
1177
+
1178
+ <li>
1179
+
1180
+
1181
+ <span class='type'>(<tt>String</tt>)</span>
1182
+
1183
+
1184
+
1185
+ </li>
1186
+
1187
+ </ul>
1188
+
1189
+ </div><table class="source_code">
1190
+ <tr>
1191
+ <td>
1192
+ <pre class="lines">
1193
+
1194
+
1195
+ 241
1196
+ 242
1197
+ 243</pre>
1198
+ </td>
1199
+ <td>
1200
+ <pre class="code"><span class="info file"># File 'lib/prismic.rb', line 241</span>
1201
+
1202
+ <span class='kw'>def</span> <span class='id identifier rubyid_form_enctype'>form_enctype</span>
1203
+ <span class='id identifier rubyid_form'>form</span><span class='period'>.</span><span class='id identifier rubyid_enctype'>enctype</span>
1204
+ <span class='kw'>end</span></pre>
1205
+ </td>
1206
+ </tr>
1207
+ </table>
1208
+ </div>
1209
+
1210
+ <div class="method_details ">
1211
+ <h3 class="signature " id="form_fields-instance_method">
1212
+
1213
+ - (<tt>String</tt>) <strong>form_fields</strong>
1214
+
1215
+
1216
+
1217
+
1218
+
1219
+ </h3><div class="docstring">
1220
+ <div class="discussion">
1221
+ <p>Returns the form&#39;s fields</p>
1222
+
1223
+
1224
+ </div>
1225
+ </div>
1226
+ <div class="tags">
1227
+
1228
+ <p class="tag_title">Returns:</p>
1229
+ <ul class="return">
1230
+
1231
+ <li>
1232
+
1233
+
1234
+ <span class='type'>(<tt>String</tt>)</span>
1235
+
1236
+
1237
+
1238
+ </li>
1239
+
1240
+ </ul>
1241
+
1242
+ </div><table class="source_code">
1243
+ <tr>
1244
+ <td>
1245
+ <pre class="lines">
1246
+
1247
+
1248
+ 255
1249
+ 256
1250
+ 257</pre>
1251
+ </td>
1252
+ <td>
1253
+ <pre class="code"><span class="info file"># File 'lib/prismic.rb', line 255</span>
1254
+
1255
+ <span class='kw'>def</span> <span class='id identifier rubyid_form_fields'>form_fields</span>
1256
+ <span class='id identifier rubyid_form'>form</span><span class='period'>.</span><span class='id identifier rubyid_fields'>fields</span>
1257
+ <span class='kw'>end</span></pre>
1258
+ </td>
1259
+ </tr>
1260
+ </table>
1261
+ </div>
1262
+
1263
+ <div class="method_details ">
1264
+ <h3 class="signature " id="form_method-instance_method">
1265
+
1266
+ - (<tt>String</tt>) <strong>form_method</strong>
1267
+
1268
+
1269
+
1270
+
1271
+
1272
+ </h3><div class="docstring">
1273
+ <div class="discussion">
1274
+ <p>Returns the form&#39;s HTTP method</p>
1275
+
1276
+
1277
+ </div>
1278
+ </div>
1279
+ <div class="tags">
1280
+
1281
+ <p class="tag_title">Returns:</p>
1282
+ <ul class="return">
1283
+
1284
+ <li>
1285
+
1286
+
1287
+ <span class='type'>(<tt>String</tt>)</span>
1288
+
1289
+
1290
+
1291
+ </li>
1292
+
1293
+ </ul>
1294
+
1295
+ </div><table class="source_code">
1296
+ <tr>
1297
+ <td>
1298
+ <pre class="lines">
1299
+
1300
+
1301
+ 227
1302
+ 228
1303
+ 229</pre>
1304
+ </td>
1305
+ <td>
1306
+ <pre class="code"><span class="info file"># File 'lib/prismic.rb', line 227</span>
1307
+
1308
+ <span class='kw'>def</span> <span class='id identifier rubyid_form_method'>form_method</span>
1309
+ <span class='id identifier rubyid_form'>form</span><span class='period'>.</span><span class='id identifier rubyid_form_method'>form_method</span>
1310
+ <span class='kw'>end</span></pre>
1311
+ </td>
1312
+ </tr>
1313
+ </table>
1314
+ </div>
1315
+
1316
+ <div class="method_details ">
1317
+ <h3 class="signature " id="form_name-instance_method">
1318
+
1319
+ - (<tt>String</tt>) <strong>form_name</strong>
1320
+
1321
+
1322
+
1323
+
1324
+
1325
+ </h3><div class="docstring">
1326
+ <div class="discussion">
1327
+ <p>Returns the form&#39;s name</p>
1328
+
1329
+
1330
+ </div>
1331
+ </div>
1332
+ <div class="tags">
1333
+
1334
+ <p class="tag_title">Returns:</p>
1335
+ <ul class="return">
1336
+
1337
+ <li>
1338
+
1339
+
1340
+ <span class='type'>(<tt>String</tt>)</span>
1341
+
1342
+
1343
+
1344
+ </li>
1345
+
1346
+ </ul>
1347
+
1348
+ </div><table class="source_code">
1349
+ <tr>
1350
+ <td>
1351
+ <pre class="lines">
1352
+
1353
+
1354
+ 220
1355
+ 221
1356
+ 222</pre>
1357
+ </td>
1358
+ <td>
1359
+ <pre class="code"><span class="info file"># File 'lib/prismic.rb', line 220</span>
1360
+
1361
+ <span class='kw'>def</span> <span class='id identifier rubyid_form_name'>form_name</span>
1362
+ <span class='id identifier rubyid_form'>form</span><span class='period'>.</span><span class='id identifier rubyid_name'>name</span>
1363
+ <span class='kw'>end</span></pre>
1364
+ </td>
1365
+ </tr>
1366
+ </table>
1367
+ </div>
1368
+
1369
+ <div class="method_details ">
1370
+ <h3 class="signature " id="form_rel-instance_method">
1371
+
1372
+ - (<tt>String</tt>) <strong>form_rel</strong>
1373
+
1374
+
1375
+
1376
+
1377
+
1378
+ </h3><div class="docstring">
1379
+ <div class="discussion">
1380
+ <p>Returns the form&#39;s relationship</p>
1381
+
1382
+
1383
+ </div>
1384
+ </div>
1385
+ <div class="tags">
1386
+
1387
+ <p class="tag_title">Returns:</p>
1388
+ <ul class="return">
1389
+
1390
+ <li>
1391
+
1392
+
1393
+ <span class='type'>(<tt>String</tt>)</span>
1394
+
1395
+
1396
+
1397
+ </li>
1398
+
1399
+ </ul>
1400
+
1401
+ </div><table class="source_code">
1402
+ <tr>
1403
+ <td>
1404
+ <pre class="lines">
1405
+
1406
+
1407
+ 234
1408
+ 235
1409
+ 236</pre>
1410
+ </td>
1411
+ <td>
1412
+ <pre class="code"><span class="info file"># File 'lib/prismic.rb', line 234</span>
1413
+
1414
+ <span class='kw'>def</span> <span class='id identifier rubyid_form_rel'>form_rel</span>
1415
+ <span class='id identifier rubyid_form'>form</span><span class='period'>.</span><span class='id identifier rubyid_rel'>rel</span>
1416
+ <span class='kw'>end</span></pre>
1417
+ </td>
1418
+ </tr>
1419
+ </table>
1420
+ </div>
1421
+
1422
+ <div class="method_details ">
1423
+ <h3 class="signature " id="orderings-instance_method">
1424
+
1425
+ - (<tt><span class='object_link'><a href="" title="Prismic::SearchForm (class)">SearchForm</a></span></tt>) <strong>orderings</strong>(orderings)
1426
+
1427
+
1428
+
1429
+
1430
+
1431
+ </h3><div class="docstring">
1432
+ <div class="discussion">
1433
+ <p>Specify a orderings for this form.</p>
1434
+
1435
+
1436
+ </div>
1437
+ </div>
1438
+ <div class="tags">
1439
+ <p class="tag_title">Parameters:</p>
1440
+ <ul class="param">
1441
+
1442
+ <li>
1443
+
1444
+ <span class='name'>orderings</span>
1445
+
1446
+
1447
+ <span class='type'>(<tt>String</tt>)</span>
1448
+
1449
+
1450
+
1451
+ &mdash;
1452
+ <div class='inline'><p>The orderings</p>
1453
+ </div>
1454
+
1455
+ </li>
1456
+
1457
+ </ul>
1458
+
1459
+ <p class="tag_title">Returns:</p>
1460
+ <ul class="return">
1461
+
1462
+ <li>
1463
+
1464
+
1465
+ <span class='type'>(<tt><span class='object_link'><a href="" title="Prismic::SearchForm (class)">SearchForm</a></span></tt>)</span>
1466
+
1467
+
1468
+
1469
+ &mdash;
1470
+ <div class='inline'><p>self</p>
1471
+ </div>
1472
+
1473
+ </li>
1474
+
1475
+ </ul>
1476
+
1477
+ </div><table class="source_code">
1478
+ <tr>
1479
+ <td>
1480
+ <pre class="lines">
1481
+
1482
+
1483
+ </pre>
1484
+ </td>
1485
+ <td>
1486
+ <pre class="code"><span class="info file"># File 'lib/prismic.rb', line 182</span>
1487
+
1488
+ </pre>
1489
+ </td>
1490
+ </tr>
1491
+ </table>
1492
+ </div>
1493
+
1494
+ <div class="method_details ">
1495
+ <h3 class="signature " id="page-instance_method">
1496
+
1497
+ - (<tt><span class='object_link'><a href="" title="Prismic::SearchForm (class)">SearchForm</a></span></tt>) <strong>page</strong>(page)
1498
+
1499
+
1500
+
1501
+
1502
+
1503
+ </h3><div class="docstring">
1504
+ <div class="discussion">
1505
+ <p>Specify a page for this form.</p>
1506
+
1507
+
1508
+ </div>
1509
+ </div>
1510
+ <div class="tags">
1511
+ <p class="tag_title">Parameters:</p>
1512
+ <ul class="param">
1513
+
1514
+ <li>
1515
+
1516
+ <span class='name'>page</span>
1517
+
1518
+
1519
+ <span class='type'>(<tt>String</tt>, <tt>Fixum</tt>)</span>
1520
+
1521
+
1522
+
1523
+ &mdash;
1524
+ <div class='inline'><p>The page</p>
1525
+ </div>
1526
+
1527
+ </li>
1528
+
1529
+ </ul>
1530
+
1531
+ <p class="tag_title">Returns:</p>
1532
+ <ul class="return">
1533
+
1534
+ <li>
1535
+
1536
+
1537
+ <span class='type'>(<tt><span class='object_link'><a href="" title="Prismic::SearchForm (class)">SearchForm</a></span></tt>)</span>
1538
+
1539
+
1540
+
1541
+ &mdash;
1542
+ <div class='inline'><p>self</p>
1543
+ </div>
1544
+
1545
+ </li>
1546
+
1547
+ </ul>
1548
+
1549
+ </div><table class="source_code">
1550
+ <tr>
1551
+ <td>
1552
+ <pre class="lines">
1553
+
1554
+
1555
+ </pre>
1556
+ </td>
1557
+ <td>
1558
+ <pre class="code"><span class="info file"># File 'lib/prismic.rb', line 187</span>
1559
+
1560
+ </pre>
1561
+ </td>
1562
+ </tr>
1563
+ </table>
1564
+ </div>
1565
+
1566
+ <div class="method_details ">
1567
+ <h3 class="signature " id="page_size-instance_method">
1568
+
1569
+ - (<tt><span class='object_link'><a href="" title="Prismic::SearchForm (class)">SearchForm</a></span></tt>) <strong>page_size</strong>(page_size)
1570
+
1571
+
1572
+
1573
+
1574
+
1575
+ </h3><div class="docstring">
1576
+ <div class="discussion">
1577
+ <p>Specify a page size for this form.</p>
1578
+
1579
+
1580
+ </div>
1581
+ </div>
1582
+ <div class="tags">
1583
+ <p class="tag_title">Parameters:</p>
1584
+ <ul class="param">
1585
+
1586
+ <li>
1587
+
1588
+ <span class='name'>page_size</span>
1589
+
1590
+
1591
+ <span class='type'>(<tt>String</tt>, <tt>Fixum</tt>)</span>
1592
+
1593
+
1594
+
1595
+ &mdash;
1596
+ <div class='inline'><p>The page size</p>
1597
+ </div>
1598
+
1599
+ </li>
1600
+
1601
+ </ul>
1602
+
1603
+ <p class="tag_title">Returns:</p>
1604
+ <ul class="return">
1605
+
1606
+ <li>
1607
+
1608
+
1609
+ <span class='type'>(<tt><span class='object_link'><a href="" title="Prismic::SearchForm (class)">SearchForm</a></span></tt>)</span>
1610
+
1611
+
1612
+
1613
+ &mdash;
1614
+ <div class='inline'><p>self</p>
1615
+ </div>
1616
+
1617
+ </li>
1618
+
1619
+ </ul>
1620
+
1621
+ </div><table class="source_code">
1622
+ <tr>
1623
+ <td>
1624
+ <pre class="lines">
1625
+
1626
+
1627
+ </pre>
1628
+ </td>
1629
+ <td>
1630
+ <pre class="code"><span class="info file"># File 'lib/prismic.rb', line 192</span>
1631
+
1632
+ </pre>
1633
+ </td>
1634
+ </tr>
1635
+ </table>
1636
+ </div>
1637
+
1638
+ <div class="method_details ">
1639
+ <h3 class="signature " id="q-instance_method">
1640
+
1641
+ - (<tt>Object</tt>) <strong>q</strong>(*query)
1642
+
1643
+
1644
+
1645
+
1646
+
1647
+ </h3><table class="source_code">
1648
+ <tr>
1649
+ <td>
1650
+ <pre class="lines">
1651
+
1652
+
1653
+ 161
1654
+ 162
1655
+ 163
1656
+ 164
1657
+ 165
1658
+ 166
1659
+ 167
1660
+ 168
1661
+ 169
1662
+ 170
1663
+ 171
1664
+ 172
1665
+ 173
1666
+ 174
1667
+ 175
1668
+ 176
1669
+ 177
1670
+ 178
1671
+ 179
1672
+ 180</pre>
1673
+ </td>
1674
+ <td>
1675
+ <pre class="code"><span class="info file"># File 'lib/prismic.rb', line 161</span>
1676
+
1677
+ <span class='kw'>def</span> <span class='id identifier rubyid_q'>q</span><span class='lparen'>(</span><span class='op'>*</span><span class='id identifier rubyid_query'>query</span><span class='rparen'>)</span>
1678
+ <span class='kw'>def</span> <span class='id identifier rubyid_serialize'>serialize</span><span class='lparen'>(</span><span class='id identifier rubyid_field'>field</span><span class='rparen'>)</span>
1679
+ <span class='kw'>if</span> <span class='id identifier rubyid_field'>field</span><span class='period'>.</span><span class='id identifier rubyid_kind_of?'>kind_of?</span><span class='lparen'>(</span><span class='const'>String</span><span class='rparen'>)</span> <span class='kw'>and</span> <span class='kw'>not</span> <span class='lparen'>(</span><span class='id identifier rubyid_field'>field</span><span class='period'>.</span><span class='id identifier rubyid_start_with?'>start_with?</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='rparen'>)</span> <span class='kw'>or</span> <span class='id identifier rubyid_field'>field</span><span class='period'>.</span><span class='id identifier rubyid_start_with?'>start_with?</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>document</span><span class='tstring_end'>&#39;</span></span><span class='rparen'>)</span><span class='rparen'>)</span>
1680
+ <span class='tstring'><span class='tstring_beg'>%(</span><span class='tstring_content'>&quot;</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_field'>field</span><span class='embexpr_end'>}</span><span class='tstring_content'>&quot;</span><span class='tstring_end'>)</span></span>
1681
+ <span class='kw'>elsif</span> <span class='id identifier rubyid_field'>field</span><span class='period'>.</span><span class='id identifier rubyid_kind_of?'>kind_of?</span><span class='lparen'>(</span><span class='const'>Array</span><span class='rparen'>)</span>
1682
+ <span class='tstring'><span class='tstring_beg'>%(</span><span class='tstring_content'>[</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_field'>field</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_arg'>arg</span><span class='op'>|</span> <span class='id identifier rubyid_serialize'>serialize</span><span class='lparen'>(</span><span class='id identifier rubyid_arg'>arg</span><span class='rparen'>)</span> <span class='rbrace'>}</span><span class='period'>.</span><span class='id identifier rubyid_join'>join</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='rparen'>)</span><span class='embexpr_end'>}</span><span class='tstring_content'>]</span><span class='tstring_end'>)</span></span>
1683
+ <span class='kw'>else</span>
1684
+ <span class='tstring'><span class='tstring_beg'>%(</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_field'>field</span><span class='embexpr_end'>}</span><span class='tstring_end'>)</span></span>
1685
+ <span class='kw'>end</span>
1686
+ <span class='kw'>end</span>
1687
+ <span class='kw'>if</span> <span class='id identifier rubyid_query'>query</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_kind_of?'>kind_of?</span><span class='lparen'>(</span><span class='const'>String</span><span class='rparen'>)</span>
1688
+ <span class='id identifier rubyid_set'>set</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>q</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span> <span class='id identifier rubyid_query'>query</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</span><span class='rparen'>)</span>
1689
+ <span class='kw'>else</span>
1690
+ <span class='id identifier rubyid_predicates'>predicates</span> <span class='op'>=</span> <span class='id identifier rubyid_query'>query</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_q'>q</span><span class='op'>|</span>
1691
+ <span class='id identifier rubyid_op'>op</span> <span class='op'>=</span> <span class='id identifier rubyid_q'>q</span><span class='period'>.</span><span class='id identifier rubyid_shift'>shift</span>
1692
+ <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>[:d = </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_op'>op</span><span class='embexpr_end'>}</span><span class='tstring_content'>(</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_q'>q</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_arg'>arg</span><span class='op'>|</span> <span class='id identifier rubyid_serialize'>serialize</span><span class='lparen'>(</span><span class='id identifier rubyid_arg'>arg</span><span class='rparen'>)</span> <span class='rbrace'>}</span><span class='period'>.</span><span class='id identifier rubyid_join'>join</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='rparen'>)</span><span class='embexpr_end'>}</span><span class='tstring_content'>)]</span><span class='tstring_end'>&quot;</span></span>
1693
+ <span class='rbrace'>}</span>
1694
+ <span class='id identifier rubyid_set'>set</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>q</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>[</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_predicates'>predicates</span> <span class='op'>*</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_end'>&#39;</span></span><span class='embexpr_end'>}</span><span class='tstring_content'>]</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span>
1695
+ <span class='kw'>end</span>
1696
+ <span class='kw'>end</span></pre>
1697
+ </td>
1698
+ </tr>
1699
+ </table>
1700
+ </div>
1701
+
1702
+ <div class="method_details ">
1703
+ <h3 class="signature " id="query-instance_method">
1704
+
1705
+ - (<tt>Object</tt>) <strong>query</strong>(*query)
1706
+
1707
+
1708
+
1709
+
1710
+
1711
+ </h3><div class="docstring">
1712
+ <div class="discussion">
1713
+ <p>Specify a query for this form.
1714
+ @param query [String] The query
1715
+ @return [SearchForm] self</p>
1716
+
1717
+
1718
+ </div>
1719
+ </div>
1720
+ <div class="tags">
1721
+
1722
+
1723
+ </div><table class="source_code">
1724
+ <tr>
1725
+ <td>
1726
+ <pre class="lines">
1727
+
1728
+
1729
+ 157
1730
+ 158
1731
+ 159</pre>
1732
+ </td>
1733
+ <td>
1734
+ <pre class="code"><span class="info file"># File 'lib/prismic.rb', line 157</span>
1735
+
1736
+ <span class='kw'>def</span> <span class='id identifier rubyid_query'>query</span><span class='lparen'>(</span><span class='op'>*</span><span class='id identifier rubyid_query'>query</span><span class='rparen'>)</span>
1737
+ <span class='id identifier rubyid_q'>q</span><span class='lparen'>(</span><span class='op'>*</span><span class='id identifier rubyid_query'>query</span><span class='rparen'>)</span>
1738
+ <span class='kw'>end</span></pre>
1739
+ </td>
1740
+ </tr>
1741
+ </table>
1742
+ </div>
1743
+
1744
+ <div class="method_details ">
1745
+ <h3 class="signature " id="serialize-instance_method">
1746
+
1747
+ - (<tt>Object</tt>) <strong>serialize</strong>(field)
1748
+
1749
+
1750
+
1751
+
1752
+
1753
+ </h3><table class="source_code">
1754
+ <tr>
1755
+ <td>
1756
+ <pre class="lines">
1757
+
1758
+
1759
+ 162
1760
+ 163
1761
+ 164
1762
+ 165
1763
+ 166
1764
+ 167
1765
+ 168
1766
+ 169
1767
+ 170</pre>
1768
+ </td>
1769
+ <td>
1770
+ <pre class="code"><span class="info file"># File 'lib/prismic.rb', line 162</span>
1771
+
1772
+ <span class='kw'>def</span> <span class='id identifier rubyid_serialize'>serialize</span><span class='lparen'>(</span><span class='id identifier rubyid_field'>field</span><span class='rparen'>)</span>
1773
+ <span class='kw'>if</span> <span class='id identifier rubyid_field'>field</span><span class='period'>.</span><span class='id identifier rubyid_kind_of?'>kind_of?</span><span class='lparen'>(</span><span class='const'>String</span><span class='rparen'>)</span> <span class='kw'>and</span> <span class='kw'>not</span> <span class='lparen'>(</span><span class='id identifier rubyid_field'>field</span><span class='period'>.</span><span class='id identifier rubyid_start_with?'>start_with?</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='rparen'>)</span> <span class='kw'>or</span> <span class='id identifier rubyid_field'>field</span><span class='period'>.</span><span class='id identifier rubyid_start_with?'>start_with?</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>document</span><span class='tstring_end'>&#39;</span></span><span class='rparen'>)</span><span class='rparen'>)</span>
1774
+ <span class='tstring'><span class='tstring_beg'>%(</span><span class='tstring_content'>&quot;</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_field'>field</span><span class='embexpr_end'>}</span><span class='tstring_content'>&quot;</span><span class='tstring_end'>)</span></span>
1775
+ <span class='kw'>elsif</span> <span class='id identifier rubyid_field'>field</span><span class='period'>.</span><span class='id identifier rubyid_kind_of?'>kind_of?</span><span class='lparen'>(</span><span class='const'>Array</span><span class='rparen'>)</span>
1776
+ <span class='tstring'><span class='tstring_beg'>%(</span><span class='tstring_content'>[</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_field'>field</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_arg'>arg</span><span class='op'>|</span> <span class='id identifier rubyid_serialize'>serialize</span><span class='lparen'>(</span><span class='id identifier rubyid_arg'>arg</span><span class='rparen'>)</span> <span class='rbrace'>}</span><span class='period'>.</span><span class='id identifier rubyid_join'>join</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='rparen'>)</span><span class='embexpr_end'>}</span><span class='tstring_content'>]</span><span class='tstring_end'>)</span></span>
1777
+ <span class='kw'>else</span>
1778
+ <span class='tstring'><span class='tstring_beg'>%(</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_field'>field</span><span class='embexpr_end'>}</span><span class='tstring_end'>)</span></span>
1779
+ <span class='kw'>end</span>
1780
+ <span class='kw'>end</span></pre>
1781
+ </td>
1782
+ </tr>
1783
+ </table>
1784
+ </div>
1785
+
1786
+ <div class="method_details ">
1787
+ <h3 class="signature " id="set-instance_method">
1788
+
1789
+ - (<tt><span class='object_link'><a href="" title="Prismic::SearchForm (class)">SearchForm</a></span></tt>) <strong>set</strong>(field_name, value)
1790
+
1791
+
1792
+
1793
+
1794
+
1795
+ </h3><div class="docstring">
1796
+ <div class="discussion">
1797
+ <p>Specify a parameter for this form</p>
1798
+
1799
+
1800
+ </div>
1801
+ </div>
1802
+ <div class="tags">
1803
+ <p class="tag_title">Parameters:</p>
1804
+ <ul class="param">
1805
+
1806
+ <li>
1807
+
1808
+ <span class='name'>field_name</span>
1809
+
1810
+
1811
+ <span class='type'>(<tt>String</tt>)</span>
1812
+
1813
+
1814
+
1815
+ &mdash;
1816
+ <div class='inline'><p>The parameter&#39;s name</p>
1817
+ </div>
1818
+
1819
+ </li>
1820
+
1821
+ <li>
1822
+
1823
+ <span class='name'>value</span>
1824
+
1825
+
1826
+ <span class='type'>(<tt>String</tt>)</span>
1827
+
1828
+
1829
+
1830
+ &mdash;
1831
+ <div class='inline'><p>The parameter&#39;s value</p>
1832
+ </div>
1833
+
1834
+ </li>
1835
+
1836
+ </ul>
1837
+
1838
+ <p class="tag_title">Returns:</p>
1839
+ <ul class="return">
1840
+
1841
+ <li>
1842
+
1843
+
1844
+ <span class='type'>(<tt><span class='object_link'><a href="" title="Prismic::SearchForm (class)">SearchForm</a></span></tt>)</span>
1845
+
1846
+
1847
+
1848
+ &mdash;
1849
+ <div class='inline'><p>self</p>
1850
+ </div>
1851
+
1852
+ </li>
1853
+
1854
+ </ul>
1855
+
1856
+ </div><table class="source_code">
1857
+ <tr>
1858
+ <td>
1859
+ <pre class="lines">
1860
+
1861
+
1862
+ 333
1863
+ 334
1864
+ 335
1865
+ 336
1866
+ 337
1867
+ 338
1868
+ 339
1869
+ 340
1870
+ 341
1871
+ 342
1872
+ 343
1873
+ 344</pre>
1874
+ </td>
1875
+ <td>
1876
+ <pre class="code"><span class="info file"># File 'lib/prismic.rb', line 333</span>
1877
+
1878
+ <span class='kw'>def</span> <span class='id identifier rubyid_set'>set</span><span class='lparen'>(</span><span class='id identifier rubyid_field_name'>field_name</span><span class='comma'>,</span> <span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span>
1879
+ <span class='id identifier rubyid_field'>field</span> <span class='op'>=</span> <span class='ivar'>@form</span><span class='period'>.</span><span class='id identifier rubyid_fields'>fields</span><span class='lbracket'>[</span><span class='id identifier rubyid_field_name'>field_name</span><span class='rbracket'>]</span>
1880
+ <span class='kw'>unless</span> <span class='id identifier rubyid_value'>value</span> <span class='op'>==</span> <span class='kw'>nil</span>
1881
+ <span class='kw'>if</span> <span class='id identifier rubyid_field'>field</span> <span class='op'>&amp;&amp;</span> <span class='id identifier rubyid_field'>field</span><span class='period'>.</span><span class='id identifier rubyid_repeatable?'>repeatable?</span>
1882
+ <span class='id identifier rubyid_data'>data</span><span class='lbracket'>[</span><span class='id identifier rubyid_field_name'>field_name</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span> <span class='kw'>unless</span> <span class='id identifier rubyid_data'>data</span><span class='period'>.</span><span class='id identifier rubyid_include?'>include?</span> <span class='id identifier rubyid_field_name'>field_name</span>
1883
+ <span class='id identifier rubyid_data'>data</span><span class='lbracket'>[</span><span class='id identifier rubyid_field_name'>field_name</span><span class='rbracket'>]</span> <span class='op'>&lt;&lt;</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span>
1884
+ <span class='kw'>else</span>
1885
+ <span class='id identifier rubyid_data'>data</span><span class='lbracket'>[</span><span class='id identifier rubyid_field_name'>field_name</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span>
1886
+ <span class='kw'>end</span>
1887
+ <span class='kw'>end</span>
1888
+ <span class='kw'>self</span>
1889
+ <span class='kw'>end</span></pre>
1890
+ </td>
1891
+ </tr>
1892
+ </table>
1893
+ </div>
1894
+
1895
+ <div class="method_details ">
1896
+ <h3 class="signature " id="submit-instance_method">
1897
+
1898
+ - (<tt><span class='object_link'><a href="Response.html" title="Prismic::Response (class)">Response</a></span></tt>) <strong>submit</strong>(ref = nil)
1899
+
1900
+
1901
+
1902
+
1903
+
1904
+ </h3><div class="docstring">
1905
+ <div class="discussion">
1906
+
1907
+ <div class="note notetag">
1908
+ <strong>Note:</strong>
1909
+ <div class='inline'><p>The reference MUST be defined, either by:</p>
1910
+
1911
+ <ul>
1912
+ <li>setting it at <span class='object_link'><a href="API.html#create_search_form-instance_method" title="Prismic::API#create_search_form (method)">creation</a></span></li>
1913
+ <li>using the <span class='object_link'><a href="#ref-instance_method" title="Prismic::SearchForm#ref (method)">#ref</a></span> method</li>
1914
+ <li>providing the ref parameter.</li>
1915
+ </ul>
1916
+ </div>
1917
+ </div>
1918
+
1919
+ <p>Submit the form</p>
1920
+
1921
+
1922
+ </div>
1923
+ </div>
1924
+ <div class="tags">
1925
+ <p class="tag_title">Parameters:</p>
1926
+ <ul class="param">
1927
+
1928
+ <li>
1929
+
1930
+ <span class='name'>ref</span>
1931
+
1932
+
1933
+ <span class='type'>(<tt><span class='object_link'><a href="Ref.html" title="Prismic::Ref (class)">Ref</a></span></tt>, <tt>String</tt>)</span>
1934
+
1935
+
1936
+ <em class="default">(defaults to: <tt>nil</tt>)</em>
1937
+
1938
+
1939
+ &mdash;
1940
+ <div class='inline'><p>The <span class='object_link'><a href="Ref.html" title="Prismic::Ref (class)">reference</a></span> to use (if not already
1941
+ defined)</p>
1942
+ </div>
1943
+
1944
+ </li>
1945
+
1946
+ </ul>
1947
+
1948
+ <p class="tag_title">Returns:</p>
1949
+ <ul class="return">
1950
+
1951
+ <li>
1952
+
1953
+
1954
+ <span class='type'>(<tt><span class='object_link'><a href="Response.html" title="Prismic::Response (class)">Response</a></span></tt>)</span>
1955
+
1956
+
1957
+
1958
+ &mdash;
1959
+ <div class='inline'><p>The results (array of Document object + pagination
1960
+ specifics)</p>
1961
+ </div>
1962
+
1963
+ </li>
1964
+
1965
+ </ul>
1966
+
1967
+ </div><table class="source_code">
1968
+ <tr>
1969
+ <td>
1970
+ <pre class="lines">
1971
+
1972
+
1973
+ 273
1974
+ 274
1975
+ 275</pre>
1976
+ </td>
1977
+ <td>
1978
+ <pre class="code"><span class="info file"># File 'lib/prismic.rb', line 273</span>
1979
+
1980
+ <span class='kw'>def</span> <span class='id identifier rubyid_submit'>submit</span><span class='lparen'>(</span><span class='id identifier rubyid_ref'>ref</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='rparen'>)</span>
1981
+ <span class='const'>Prismic</span><span class='op'>::</span><span class='const'>JsonParser</span><span class='period'>.</span><span class='id identifier rubyid_response_parser'>response_parser</span><span class='lparen'>(</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_submit_raw'>submit_raw</span><span class='lparen'>(</span><span class='id identifier rubyid_ref'>ref</span><span class='rparen'>)</span><span class='rparen'>)</span><span class='rparen'>)</span>
1982
+ <span class='kw'>end</span></pre>
1983
+ </td>
1984
+ </tr>
1985
+ </table>
1986
+ </div>
1987
+
1988
+ <div class="method_details ">
1989
+ <h3 class="signature " id="submit_raw-instance_method">
1990
+
1991
+ - (<tt>string</tt>) <strong>submit_raw</strong>(ref = nil)
1992
+
1993
+
1994
+
1995
+
1996
+
1997
+ </h3><div class="docstring">
1998
+ <div class="discussion">
1999
+
2000
+ <div class="note notetag">
2001
+ <strong>Note:</strong>
2002
+ <div class='inline'><p>The reference MUST be defined, either by:</p>
2003
+
2004
+ <ul>
2005
+ <li>setting it at <span class='object_link'><a href="API.html#create_search_form-instance_method" title="Prismic::API#create_search_form (method)">creation</a></span></li>
2006
+ <li>using the <span class='object_link'><a href="#ref-instance_method" title="Prismic::SearchForm#ref (method)">#ref</a></span> method</li>
2007
+ <li>providing the ref parameter.</li>
2008
+ </ul>
2009
+ </div>
2010
+ </div>
2011
+
2012
+ <p>Submit the form, returns a raw JSON string</p>
2013
+
2014
+
2015
+ </div>
2016
+ </div>
2017
+ <div class="tags">
2018
+ <p class="tag_title">Parameters:</p>
2019
+ <ul class="param">
2020
+
2021
+ <li>
2022
+
2023
+ <span class='name'>ref</span>
2024
+
2025
+
2026
+ <span class='type'>(<tt><span class='object_link'><a href="Ref.html" title="Prismic::Ref (class)">Ref</a></span></tt>, <tt>String</tt>)</span>
2027
+
2028
+
2029
+ <em class="default">(defaults to: <tt>nil</tt>)</em>
2030
+
2031
+
2032
+ &mdash;
2033
+ <div class='inline'><p>The <span class='object_link'><a href="Ref.html" title="Prismic::Ref (class)">reference</a></span> to use (if not already
2034
+ defined)</p>
2035
+ </div>
2036
+
2037
+ </li>
2038
+
2039
+ </ul>
2040
+
2041
+ <p class="tag_title">Returns:</p>
2042
+ <ul class="return">
2043
+
2044
+ <li>
2045
+
2046
+
2047
+ <span class='type'>(<tt>string</tt>)</span>
2048
+
2049
+
2050
+
2051
+ &mdash;
2052
+ <div class='inline'><p>The JSON string returned by the API</p>
2053
+ </div>
2054
+
2055
+ </li>
2056
+
2057
+ </ul>
2058
+ <p class="tag_title">Raises:</p>
2059
+ <ul class="raise">
2060
+
2061
+ <li>
2062
+
2063
+
2064
+ <span class='type'>(<tt><span class='object_link'><a href="SearchForm/NoRefSetException.html" title="Prismic::SearchForm::NoRefSetException (class)">NoRefSetException</a></span></tt>)</span>
2065
+
2066
+
2067
+
2068
+ </li>
2069
+
2070
+ </ul>
2071
+
2072
+ </div><table class="source_code">
2073
+ <tr>
2074
+ <td>
2075
+ <pre class="lines">
2076
+
2077
+
2078
+ 290
2079
+ 291
2080
+ 292
2081
+ 293
2082
+ 294
2083
+ 295
2084
+ 296
2085
+ 297
2086
+ 298
2087
+ 299
2088
+ 300
2089
+ 301
2090
+ 302
2091
+ 303
2092
+ 304
2093
+ 305
2094
+ 306
2095
+ 307
2096
+ 308
2097
+ 309
2098
+ 310
2099
+ 311
2100
+ 312
2101
+ 313
2102
+ 314
2103
+ 315
2104
+ 316
2105
+ 317
2106
+ 318
2107
+ 319
2108
+ 320
2109
+ 321
2110
+ 322
2111
+ 323
2112
+ 324
2113
+ 325
2114
+ 326</pre>
2115
+ </td>
2116
+ <td>
2117
+ <pre class="code"><span class="info file"># File 'lib/prismic.rb', line 290</span>
2118
+
2119
+ <span class='kw'>def</span> <span class='id identifier rubyid_submit_raw'>submit_raw</span><span class='lparen'>(</span><span class='id identifier rubyid_ref'>ref</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='rparen'>)</span>
2120
+ <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_ref'>ref</span><span class='lparen'>(</span><span class='id identifier rubyid_ref'>ref</span><span class='rparen'>)</span> <span class='kw'>if</span> <span class='id identifier rubyid_ref'>ref</span>
2121
+ <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='ivar'>@ref</span>
2122
+ <span class='id identifier rubyid_raise'>raise</span> <span class='const'>NoRefSetException</span> <span class='kw'>unless</span> <span class='ivar'>@ref</span>
2123
+
2124
+ <span class='comment'># cache_key is a mix of HTTP URL and HTTP method
2125
+ </span> <span class='id identifier rubyid_cache_key'>cache_key</span> <span class='op'>=</span> <span class='id identifier rubyid_form_method'>form_method</span><span class='op'>+</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_form_action'>form_action</span><span class='op'>+</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_data'>data</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_v'>v</span><span class='op'>|</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_k'>k</span><span class='embexpr_end'>}</span><span class='tstring_content'>=</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_v'>v</span><span class='embexpr_end'>}</span><span class='tstring_end'>&quot;</span></span><span class='rbrace'>}</span><span class='period'>.</span><span class='id identifier rubyid_join'>join</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>&amp;</span><span class='tstring_end'>&#39;</span></span><span class='rparen'>)</span>
2126
+
2127
+ <span class='id identifier rubyid_from_cache'>from_cache</span> <span class='op'>=</span> <span class='id identifier rubyid_api'>api</span><span class='period'>.</span><span class='id identifier rubyid_has_cache?'>has_cache?</span> <span class='op'>&amp;&amp;</span> <span class='id identifier rubyid_api'>api</span><span class='period'>.</span><span class='id identifier rubyid_cache'>cache</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='id identifier rubyid_cache_key'>cache_key</span><span class='rparen'>)</span>
2128
+ <span class='kw'>if</span> <span class='lparen'>(</span><span class='id identifier rubyid_from_cache'>from_cache</span><span class='rparen'>)</span>
2129
+ <span class='id identifier rubyid_from_cache'>from_cache</span>
2130
+ <span class='kw'>else</span>
2131
+ <span class='kw'>if</span> <span class='id identifier rubyid_form_method'>form_method</span> <span class='op'>==</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>GET</span><span class='tstring_end'>&#39;</span></span> <span class='op'>&amp;&amp;</span> <span class='id identifier rubyid_form_enctype'>form_enctype</span> <span class='op'>==</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>application/x-www-form-urlencoded</span><span class='tstring_end'>&#39;</span></span>
2132
+ <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_api'>api</span><span class='period'>.</span><span class='id identifier rubyid_access_token'>access_token</span> <span class='kw'>if</span> <span class='id identifier rubyid_api'>api</span><span class='period'>.</span><span class='id identifier rubyid_access_token'>access_token</span>
2133
+ <span class='id identifier rubyid_data'>data</span><span class='period'>.</span><span class='id identifier rubyid_delete_if'>delete_if</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_v'>v</span><span class='op'>|</span> <span class='id identifier rubyid_v'>v</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span> <span class='rbrace'>}</span>
2134
+
2135
+ <span class='id identifier rubyid_response'>response</span> <span class='op'>=</span> <span class='id identifier rubyid_api'>api</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_form_action'>form_action</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>
2136
+
2137
+ <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>
2138
+ <span class='id identifier rubyid_ttl'>ttl</span> <span class='op'>=</span> <span class='lparen'>(</span><span class='id identifier rubyid_response'>response</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Cache-Control</span><span class='tstring_end'>&#39;</span></span><span class='rbracket'>]</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><span class='period'>.</span><span class='id identifier rubyid_scan'>scan</span><span class='lparen'>(</span><span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>max-age\s*=\s*(\d+)</span><span class='regexp_end'>/</span></span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_flatten'>flatten</span><span class='period'>.</span><span class='id identifier rubyid_first'>first</span>
2139
+ <span class='kw'>if</span> <span class='id identifier rubyid_ttl'>ttl</span> <span class='op'>!=</span> <span class='kw'>nil</span> <span class='op'>&amp;&amp;</span> <span class='id identifier rubyid_api'>api</span><span class='period'>.</span><span class='id identifier rubyid_has_cache?'>has_cache?</span>
2140
+ <span class='id identifier rubyid_api'>api</span><span class='period'>.</span><span class='id identifier rubyid_cache'>cache</span><span class='period'>.</span><span class='id identifier rubyid_set'>set</span><span class='lparen'>(</span><span class='id identifier rubyid_cache_key'>cache_key</span><span class='comma'>,</span> <span class='id identifier rubyid_response'>response</span><span class='period'>.</span><span class='id identifier rubyid_body'>body</span><span class='comma'>,</span> <span class='id identifier rubyid_ttl'>ttl</span><span class='period'>.</span><span class='id identifier rubyid_to_i'>to_i</span><span class='rparen'>)</span>
2141
+ <span class='kw'>end</span>
2142
+ <span class='id identifier rubyid_response'>response</span><span class='period'>.</span><span class='id identifier rubyid_body'>body</span>
2143
+ <span class='kw'>else</span>
2144
+ <span class='id identifier rubyid_body'>body</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> <span class='kw'>rescue</span> <span class='kw'>nil</span>
2145
+ <span class='id identifier rubyid_error'>error</span> <span class='op'>=</span> <span class='id identifier rubyid_body'>body</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>Hash</span><span class='rparen'>)</span> <span class='op'>?</span> <span class='id identifier rubyid_body'>body</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='op'>:</span> <span class='id identifier rubyid_response'>response</span><span class='period'>.</span><span class='id identifier rubyid_body'>body</span>
2146
+ <span class='id identifier rubyid_raise'>raise</span> <span class='const'>AuthenticationException</span><span class='comma'>,</span> <span class='id identifier rubyid_error'>error</span> <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'>401</span><span class='tstring_end'>&#39;</span></span>
2147
+ <span class='id identifier rubyid_raise'>raise</span> <span class='const'>AuthorizationException</span><span class='comma'>,</span> <span class='id identifier rubyid_error'>error</span> <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'>403</span><span class='tstring_end'>&#39;</span></span>
2148
+ <span class='id identifier rubyid_raise'>raise</span> <span class='const'>RefNotFoundException</span><span class='comma'>,</span> <span class='id identifier rubyid_error'>error</span> <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'>404</span><span class='tstring_end'>&#39;</span></span>
2149
+ <span class='id identifier rubyid_raise'>raise</span> <span class='const'>FormSearchException</span><span class='comma'>,</span> <span class='id identifier rubyid_error'>error</span>
2150
+ <span class='kw'>end</span>
2151
+ <span class='kw'>else</span>
2152
+ <span class='id identifier rubyid_raise'>raise</span> <span class='const'>UnsupportedFormKind</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Unsupported kind of form: </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_form_method'>form_method</span><span class='embexpr_end'>}</span><span class='tstring_content'> / </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_enctype'>enctype</span><span class='embexpr_end'>}</span><span class='tstring_end'>&quot;</span></span>
2153
+ <span class='kw'>end</span>
2154
+ <span class='kw'>end</span>
2155
+ <span class='kw'>end</span></pre>
2156
+ </td>
2157
+ </tr>
2158
+ </table>
2159
+ </div>
2160
+
2161
+ </div>
2162
+
2163
+ </div>
2164
+
2165
+ <div id="footer">
2166
+ Generated on Tue Sep 27 10:47:06 2016 by
2167
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
2168
+ 0.8.7.4 (ruby-2.0.0).
2169
+ </div>
2170
+
2171
+ </body>
2172
+ </html>