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,633 @@
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::Experiments
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/Experiments.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 (E)</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">Experiments</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::Experiments
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::Experiments</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/experiments.rb</dd>
98
+
99
+ </dl>
100
+ <div class="clear"></div>
101
+
102
+
103
+
104
+
105
+
106
+ <h2>Instance Attribute Summary <small>(<a href="#" class="summary_toggle">collapse</a>)</small></h2>
107
+ <ul class="summary">
108
+
109
+ <li class="public ">
110
+ <span class="summary_signature">
111
+
112
+ <a href="#draft-instance_method" title="#draft (instance method)">- (Array&lt;Experiment&gt;) <strong>draft</strong> </a>
113
+
114
+
115
+
116
+ </span>
117
+
118
+
119
+
120
+
121
+ <span class="note title readonly">readonly</span>
122
+
123
+
124
+
125
+
126
+
127
+
128
+
129
+
130
+
131
+ <span class="summary_desc"><div class='inline'><p>List of all experiments from Prismic.</p>
132
+ </div></span>
133
+
134
+ </li>
135
+
136
+
137
+ <li class="public ">
138
+ <span class="summary_signature">
139
+
140
+ <a href="#running-instance_method" title="#running (instance method)">- (Array&lt;Experiments&gt;) <strong>running</strong> </a>
141
+
142
+
143
+
144
+ </span>
145
+
146
+
147
+
148
+
149
+ <span class="note title readonly">readonly</span>
150
+
151
+
152
+
153
+
154
+
155
+
156
+
157
+
158
+
159
+ <span class="summary_desc"><div class='inline'><p>List of all experiments from Prismic.</p>
160
+ </div></span>
161
+
162
+ </li>
163
+
164
+
165
+ </ul>
166
+
167
+
168
+
169
+
170
+
171
+ <h2>
172
+ Class Method Summary
173
+ <small>(<a href="#" class="summary_toggle">collapse</a>)</small>
174
+ </h2>
175
+
176
+ <ul class="summary">
177
+
178
+ <li class="public ">
179
+ <span class="summary_signature">
180
+
181
+ <a href="#parse-class_method" title="parse (class method)">+ (Experiments) <strong>parse</strong>(data) </a>
182
+
183
+
184
+
185
+ </span>
186
+
187
+
188
+
189
+
190
+
191
+
192
+
193
+
194
+
195
+ <span class="summary_desc"><div class='inline'></div></span>
196
+
197
+ </li>
198
+
199
+
200
+ </ul>
201
+
202
+ <h2>
203
+ Instance Method Summary
204
+ <small>(<a href="#" class="summary_toggle">collapse</a>)</small>
205
+ </h2>
206
+
207
+ <ul class="summary">
208
+
209
+ <li class="public ">
210
+ <span class="summary_signature">
211
+
212
+ <a href="#current-instance_method" title="#current (instance method)">- (Object) <strong>current</strong> </a>
213
+
214
+
215
+
216
+ </span>
217
+
218
+
219
+
220
+
221
+
222
+
223
+
224
+
225
+
226
+ <span class="summary_desc"><div class='inline'></div></span>
227
+
228
+ </li>
229
+
230
+
231
+ <li class="public ">
232
+ <span class="summary_signature">
233
+
234
+ <a href="#initialize-instance_method" title="#initialize (instance method)">- (Experiments) <strong>initialize</strong>(draft, running) </a>
235
+
236
+
237
+
238
+ </span>
239
+
240
+
241
+ <span class="note title constructor">constructor</span>
242
+
243
+
244
+
245
+
246
+
247
+
248
+
249
+
250
+ <span class="summary_desc"><div class='inline'><p>A new instance of Experiments.</p>
251
+ </div></span>
252
+
253
+ </li>
254
+
255
+
256
+ <li class="public ">
257
+ <span class="summary_signature">
258
+
259
+ <a href="#ref_from_cookie-instance_method" title="#ref_from_cookie (instance method)">- (Object) <strong>ref_from_cookie</strong>(cookie) </a>
260
+
261
+
262
+
263
+ </span>
264
+
265
+
266
+
267
+
268
+
269
+
270
+
271
+
272
+
273
+ <span class="summary_desc"><div class='inline'></div></span>
274
+
275
+ </li>
276
+
277
+
278
+ </ul>
279
+
280
+
281
+ <div id="constructor_details" class="method_details_list">
282
+ <h2>Constructor Details</h2>
283
+
284
+ <div class="method_details first">
285
+ <h3 class="signature first" id="initialize-instance_method">
286
+
287
+ - (<tt><span class='object_link'><a href="" title="Prismic::Experiments (class)">Experiments</a></span></tt>) <strong>initialize</strong>(draft, running)
288
+
289
+
290
+
291
+
292
+
293
+ </h3><div class="docstring">
294
+ <div class="discussion">
295
+ <p>Returns a new instance of Experiments</p>
296
+
297
+
298
+ </div>
299
+ </div>
300
+ <div class="tags">
301
+
302
+
303
+ </div><table class="source_code">
304
+ <tr>
305
+ <td>
306
+ <pre class="lines">
307
+
308
+
309
+ 10
310
+ 11
311
+ 12
312
+ 13</pre>
313
+ </td>
314
+ <td>
315
+ <pre class="code"><span class="info file"># File 'lib/prismic/experiments.rb', line 10</span>
316
+
317
+ <span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_draft'>draft</span><span class='comma'>,</span> <span class='id identifier rubyid_running'>running</span><span class='rparen'>)</span>
318
+ <span class='ivar'>@draft</span> <span class='op'>=</span> <span class='id identifier rubyid_draft'>draft</span>
319
+ <span class='ivar'>@running</span> <span class='op'>=</span> <span class='id identifier rubyid_running'>running</span>
320
+ <span class='kw'>end</span></pre>
321
+ </td>
322
+ </tr>
323
+ </table>
324
+ </div>
325
+
326
+ </div>
327
+
328
+ <div id="instance_attr_details" class="attr_details">
329
+ <h2>Instance Attribute Details</h2>
330
+
331
+
332
+ <span id=""></span>
333
+ <div class="method_details first">
334
+ <h3 class="signature first" id="draft-instance_method">
335
+
336
+ - (<tt>Array&lt;<span class='object_link'><a href="Experiment.html" title="Prismic::Experiment (class)">Experiment</a></span>&gt;</tt>) <strong>draft</strong> <span class="extras">(readonly)</span>
337
+
338
+
339
+
340
+
341
+
342
+ </h3><div class="docstring">
343
+ <div class="discussion">
344
+ <p>Returns list of all experiments from Prismic</p>
345
+
346
+
347
+ </div>
348
+ </div>
349
+ <div class="tags">
350
+
351
+ <p class="tag_title">Returns:</p>
352
+ <ul class="return">
353
+
354
+ <li>
355
+
356
+
357
+ <span class='type'>(<tt>Array&lt;<span class='object_link'><a href="Experiment.html" title="Prismic::Experiment (class)">Experiment</a></span>&gt;</tt>)</span>
358
+
359
+
360
+
361
+ &mdash;
362
+ <div class='inline'><p>list of all experiments from Prismic</p>
363
+ </div>
364
+
365
+ </li>
366
+
367
+ </ul>
368
+
369
+ </div><table class="source_code">
370
+ <tr>
371
+ <td>
372
+ <pre class="lines">
373
+
374
+
375
+ 6
376
+ 7
377
+ 8</pre>
378
+ </td>
379
+ <td>
380
+ <pre class="code"><span class="info file"># File 'lib/prismic/experiments.rb', line 6</span>
381
+
382
+ <span class='kw'>def</span> <span class='id identifier rubyid_draft'>draft</span>
383
+ <span class='ivar'>@draft</span>
384
+ <span class='kw'>end</span></pre>
385
+ </td>
386
+ </tr>
387
+ </table>
388
+ </div>
389
+
390
+
391
+ <span id=""></span>
392
+ <div class="method_details ">
393
+ <h3 class="signature " id="running-instance_method">
394
+
395
+ - (<tt>Array&lt;<span class='object_link'><a href="" title="Prismic::Experiments (class)">Experiments</a></span>&gt;</tt>) <strong>running</strong> <span class="extras">(readonly)</span>
396
+
397
+
398
+
399
+
400
+
401
+ </h3><div class="docstring">
402
+ <div class="discussion">
403
+ <p>Returns list of all experiments from Prismic</p>
404
+
405
+
406
+ </div>
407
+ </div>
408
+ <div class="tags">
409
+
410
+ <p class="tag_title">Returns:</p>
411
+ <ul class="return">
412
+
413
+ <li>
414
+
415
+
416
+ <span class='type'>(<tt>Array&lt;<span class='object_link'><a href="" title="Prismic::Experiments (class)">Experiments</a></span>&gt;</tt>)</span>
417
+
418
+
419
+
420
+ &mdash;
421
+ <div class='inline'><p>list of all experiments from Prismic</p>
422
+ </div>
423
+
424
+ </li>
425
+
426
+ </ul>
427
+
428
+ </div><table class="source_code">
429
+ <tr>
430
+ <td>
431
+ <pre class="lines">
432
+
433
+
434
+ 8
435
+ 9
436
+ 10</pre>
437
+ </td>
438
+ <td>
439
+ <pre class="code"><span class="info file"># File 'lib/prismic/experiments.rb', line 8</span>
440
+
441
+ <span class='kw'>def</span> <span class='id identifier rubyid_running'>running</span>
442
+ <span class='ivar'>@running</span>
443
+ <span class='kw'>end</span></pre>
444
+ </td>
445
+ </tr>
446
+ </table>
447
+ </div>
448
+
449
+ </div>
450
+
451
+
452
+ <div id="class_method_details" class="method_details_list">
453
+ <h2>Class Method Details</h2>
454
+
455
+
456
+ <div class="method_details first">
457
+ <h3 class="signature first" id="parse-class_method">
458
+
459
+ + (<tt><span class='object_link'><a href="" title="Prismic::Experiments (class)">Experiments</a></span></tt>) <strong>parse</strong>(data)
460
+
461
+
462
+
463
+
464
+
465
+ </h3><div class="docstring">
466
+ <div class="discussion">
467
+
468
+
469
+ </div>
470
+ </div>
471
+ <div class="tags">
472
+
473
+ <p class="tag_title">Returns:</p>
474
+ <ul class="return">
475
+
476
+ <li>
477
+
478
+
479
+ <span class='type'>(<tt><span class='object_link'><a href="" title="Prismic::Experiments (class)">Experiments</a></span></tt>)</span>
480
+
481
+
482
+
483
+ </li>
484
+
485
+ </ul>
486
+
487
+ </div><table class="source_code">
488
+ <tr>
489
+ <td>
490
+ <pre class="lines">
491
+
492
+
493
+ 38
494
+ 39
495
+ 40
496
+ 41
497
+ 42
498
+ 43
499
+ 44
500
+ 45
501
+ 46
502
+ 47
503
+ 48
504
+ 49
505
+ 50</pre>
506
+ </td>
507
+ <td>
508
+ <pre class="code"><span class="info file"># File 'lib/prismic/experiments.rb', line 38</span>
509
+
510
+ <span class='kw'>def</span> <span class='kw'>self</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='rparen'>)</span>
511
+ <span class='id identifier rubyid_draft'>draft</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
512
+ <span class='id identifier rubyid_running'>running</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
513
+ <span class='kw'>if</span> <span class='id identifier rubyid_data'>data</span> <span class='op'>!=</span> <span class='kw'>nil</span>
514
+ <span class='id identifier rubyid_draft'>draft</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'>draft</span><span class='tstring_end'>&#39;</span></span><span class='rbracket'>]</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_exp'>exp</span><span class='op'>|</span>
515
+ <span class='const'>Experiment</span><span class='period'>.</span><span class='id identifier rubyid_parse'>parse</span><span class='lparen'>(</span><span class='id identifier rubyid_exp'>exp</span><span class='rparen'>)</span>
516
+ <span class='rbrace'>}</span>
517
+ <span class='id identifier rubyid_running'>running</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'>running</span><span class='tstring_end'>&#39;</span></span><span class='rbracket'>]</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_exp'>exp</span><span class='op'>|</span>
518
+ <span class='const'>Experiment</span><span class='period'>.</span><span class='id identifier rubyid_parse'>parse</span><span class='lparen'>(</span><span class='id identifier rubyid_exp'>exp</span><span class='rparen'>)</span>
519
+ <span class='rbrace'>}</span>
520
+ <span class='kw'>end</span>
521
+ <span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_draft'>draft</span><span class='comma'>,</span> <span class='id identifier rubyid_running'>running</span><span class='rparen'>)</span>
522
+ <span class='kw'>end</span></pre>
523
+ </td>
524
+ </tr>
525
+ </table>
526
+ </div>
527
+
528
+ </div>
529
+
530
+ <div id="instance_method_details" class="method_details_list">
531
+ <h2>Instance Method Details</h2>
532
+
533
+
534
+ <div class="method_details first">
535
+ <h3 class="signature first" id="current-instance_method">
536
+
537
+ - (<tt>Object</tt>) <strong>current</strong>
538
+
539
+
540
+
541
+
542
+
543
+ </h3><table class="source_code">
544
+ <tr>
545
+ <td>
546
+ <pre class="lines">
547
+
548
+
549
+ 15
550
+ 16
551
+ 17</pre>
552
+ </td>
553
+ <td>
554
+ <pre class="code"><span class="info file"># File 'lib/prismic/experiments.rb', line 15</span>
555
+
556
+ <span class='kw'>def</span> <span class='id identifier rubyid_current'>current</span>
557
+ <span class='id identifier rubyid_running'>running</span><span class='period'>.</span><span class='id identifier rubyid_first'>first</span>
558
+ <span class='kw'>end</span></pre>
559
+ </td>
560
+ </tr>
561
+ </table>
562
+ </div>
563
+
564
+ <div class="method_details ">
565
+ <h3 class="signature " id="ref_from_cookie-instance_method">
566
+
567
+ - (<tt>Object</tt>) <strong>ref_from_cookie</strong>(cookie)
568
+
569
+
570
+
571
+
572
+
573
+ </h3><table class="source_code">
574
+ <tr>
575
+ <td>
576
+ <pre class="lines">
577
+
578
+
579
+ 19
580
+ 20
581
+ 21
582
+ 22
583
+ 23
584
+ 24
585
+ 25
586
+ 26
587
+ 27
588
+ 28
589
+ 29
590
+ 30
591
+ 31
592
+ 32
593
+ 33
594
+ 34
595
+ 35</pre>
596
+ </td>
597
+ <td>
598
+ <pre class="code"><span class="info file"># File 'lib/prismic/experiments.rb', line 19</span>
599
+
600
+ <span class='kw'>def</span> <span class='id identifier rubyid_ref_from_cookie'>ref_from_cookie</span><span class='lparen'>(</span><span class='id identifier rubyid_cookie'>cookie</span><span class='rparen'>)</span>
601
+ <span class='kw'>if</span> <span class='id identifier rubyid_cookie'>cookie</span> <span class='op'>==</span> <span class='kw'>nil</span>
602
+ <span class='kw'>return</span> <span class='kw'>nil</span>
603
+ <span class='kw'>end</span>
604
+ <span class='id identifier rubyid_splitted'>splitted</span> <span class='op'>=</span> <span class='id identifier rubyid_cookie'>cookie</span><span class='period'>.</span><span class='id identifier rubyid_strip'>strip</span><span class='period'>.</span><span class='id identifier rubyid_split'>split</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>%20</span><span class='tstring_end'>&#39;</span></span><span class='rparen'>)</span>
605
+ <span class='kw'>if</span> <span class='id identifier rubyid_splitted'>splitted</span><span class='period'>.</span><span class='id identifier rubyid_size'>size</span> <span class='op'>&gt;=</span> <span class='int'>2</span>
606
+ <span class='id identifier rubyid_experiment'>experiment</span> <span class='op'>=</span> <span class='id identifier rubyid_running'>running</span><span class='period'>.</span><span class='id identifier rubyid_find'>find</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_exp'>exp</span><span class='op'>|</span> <span class='id identifier rubyid_exp'>exp</span><span class='period'>.</span><span class='id identifier rubyid_google_id'>google_id</span> <span class='op'>==</span> <span class='id identifier rubyid_splitted'>splitted</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</span> <span class='rbrace'>}</span>
607
+ <span class='kw'>if</span> <span class='id identifier rubyid_experiment'>experiment</span> <span class='op'>==</span> <span class='kw'>nil</span>
608
+ <span class='kw'>return</span> <span class='kw'>nil</span>
609
+ <span class='kw'>end</span>
610
+ <span class='id identifier rubyid_var_index'>var_index</span> <span class='op'>=</span> <span class='id identifier rubyid_splitted'>splitted</span><span class='lbracket'>[</span><span class='int'>1</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_to_i'>to_i</span>
611
+ <span class='kw'>if</span> <span class='id identifier rubyid_var_index'>var_index</span> <span class='op'>&gt;</span> <span class='op'>-</span><span class='int'>1</span> <span class='op'>&amp;&amp;</span> <span class='id identifier rubyid_var_index'>var_index</span> <span class='op'>&lt;</span> <span class='id identifier rubyid_experiment'>experiment</span><span class='period'>.</span><span class='id identifier rubyid_variations'>variations</span><span class='period'>.</span><span class='id identifier rubyid_size'>size</span>
612
+ <span class='kw'>return</span> <span class='id identifier rubyid_experiment'>experiment</span><span class='period'>.</span><span class='id identifier rubyid_variations'>variations</span><span class='lbracket'>[</span><span class='id identifier rubyid_var_index'>var_index</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_ref'>ref</span>
613
+ <span class='kw'>end</span>
614
+ <span class='kw'>end</span>
615
+ <span class='kw'>nil</span>
616
+ <span class='kw'>end</span></pre>
617
+ </td>
618
+ </tr>
619
+ </table>
620
+ </div>
621
+
622
+ </div>
623
+
624
+ </div>
625
+
626
+ <div id="footer">
627
+ Generated on Tue Sep 27 10:47:06 2016 by
628
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
629
+ 0.8.7.4 (ruby-2.0.0).
630
+ </div>
631
+
632
+ </body>
633
+ </html>