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,147 @@
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
+ Exception: Prismic::API::BadPrismicResponseError
8
+
9
+ &mdash; Documentation by YARD 0.8.7.4
10
+
11
+ </title>
12
+
13
+ <link rel="stylesheet" href="../../css/style.css" type="text/css" charset="utf-8" />
14
+
15
+ <link rel="stylesheet" href="../../css/common.css" type="text/css" charset="utf-8" />
16
+
17
+ <script type="text/javascript" charset="utf-8">
18
+ hasFrames = window.top.frames.main ? true : false;
19
+ relpath = '../../';
20
+ framesUrl = "../../frames.html#!Prismic/API/BadPrismicResponseError.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 (B)</a> &raquo;
35
+ <span class='title'><span class='object_link'><a href="../../Prismic.html" title="Prismic (module)">Prismic</a></span></span> &raquo; <span class='title'><span class='object_link'><a href="../API.html" title="Prismic::API (class)">API</a></span></span>
36
+ &raquo;
37
+ <span class="title">BadPrismicResponseError</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>Exception: Prismic::API::BadPrismicResponseError
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"><span class='object_link'><a href="../Error.html" title="Prismic::Error (class)">Error</a></span></span>
77
+
78
+ <ul class="fullTree">
79
+ <li>Object</li>
80
+
81
+ <li class="next">Exception</li>
82
+
83
+ <li class="next"><span class='object_link'><a href="../Error.html" title="Prismic::Error (class)">Error</a></span></li>
84
+
85
+ <li class="next">Prismic::API::BadPrismicResponseError</li>
86
+
87
+ </ul>
88
+ <a href="#" class="inheritanceTree">show all</a>
89
+
90
+ </dd>
91
+
92
+
93
+
94
+
95
+
96
+
97
+
98
+
99
+
100
+ <dt class="r2 last">Defined in:</dt>
101
+ <dd class="r2 last">lib/prismic/api.rb</dd>
102
+
103
+ </dl>
104
+ <div class="clear"></div>
105
+
106
+
107
+
108
+
109
+
110
+
111
+
112
+ <h2>Instance Attribute Summary</h2>
113
+
114
+ <h3 class="inherited">Attributes inherited from <span class='object_link'><a href="../Error.html" title="Prismic::Error (class)">Error</a></span></h3>
115
+ <p class="inherited"><span class='object_link'><a href="../Error.html#cause-instance_method" title="Prismic::Error#cause (method)">#cause</a></span></p>
116
+
117
+
118
+
119
+
120
+
121
+
122
+
123
+
124
+
125
+ <h2>Method Summary</h2>
126
+
127
+ <h3 class="inherited">Methods inherited from <span class='object_link'><a href="../Error.html" title="Prismic::Error (class)">Error</a></span></h3>
128
+ <p class="inherited"><span class='object_link'><a href="../Error.html#full_trace-instance_method" title="Prismic::Error#full_trace (method)">#full_trace</a></span>, <span class='object_link'><a href="../Error.html#initialize-instance_method" title="Prismic::Error#initialize (method)">#initialize</a></span></p>
129
+
130
+ <div id="constructor_details" class="method_details_list">
131
+ <h2>Constructor Details</h2>
132
+
133
+ <p class="notice">This class inherits a constructor from <span class='object_link'><a href="../Error.html#initialize-instance_method" title="Prismic::Error#initialize (method)">Prismic::Error</a></span></p>
134
+
135
+ </div>
136
+
137
+
138
+ </div>
139
+
140
+ <div id="footer">
141
+ Generated on Tue Sep 27 10:47:06 2016 by
142
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
143
+ 0.8.7.4 (ruby-2.0.0).
144
+ </div>
145
+
146
+ </body>
147
+ </html>
@@ -0,0 +1,560 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4
+ <head>
5
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6
+ <title>
7
+ Class: Prismic::API::OAuth
8
+
9
+ &mdash; Documentation by YARD 0.8.7.4
10
+
11
+ </title>
12
+
13
+ <link rel="stylesheet" href="../../css/style.css" type="text/css" charset="utf-8" />
14
+
15
+ <link rel="stylesheet" href="../../css/common.css" type="text/css" charset="utf-8" />
16
+
17
+ <script type="text/javascript" charset="utf-8">
18
+ hasFrames = window.top.frames.main ? true : false;
19
+ relpath = '../../';
20
+ framesUrl = "../../frames.html#!Prismic/API/OAuth.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 (O)</a> &raquo;
35
+ <span class='title'><span class='object_link'><a href="../../Prismic.html" title="Prismic (module)">Prismic</a></span></span> &raquo; <span class='title'><span class='object_link'><a href="../API.html" title="Prismic::API (class)">API</a></span></span>
36
+ &raquo;
37
+ <span class="title">OAuth</span>
38
+
39
+
40
+ <div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
41
+ </div>
42
+
43
+ <div id="search">
44
+
45
+ <a class="full_list_link" id="class_list_link"
46
+ href="../../class_list.html">
47
+ Class List
48
+ </a>
49
+
50
+ <a class="full_list_link" id="method_list_link"
51
+ href="../../method_list.html">
52
+ Method List
53
+ </a>
54
+
55
+ <a class="full_list_link" id="file_list_link"
56
+ href="../../file_list.html">
57
+ File List
58
+ </a>
59
+
60
+ </div>
61
+ <div class="clear"></div>
62
+ </div>
63
+
64
+ <iframe id="search_frame"></iframe>
65
+
66
+ <div id="content"><h1>Class: Prismic::API::OAuth
67
+
68
+
69
+
70
+ </h1>
71
+
72
+ <dl class="box">
73
+
74
+ <dt class="r1">Inherits:</dt>
75
+ <dd class="r1">
76
+ <span class="inheritName">Object</span>
77
+
78
+ <ul class="fullTree">
79
+ <li>Object</li>
80
+
81
+ <li class="next">Prismic::API::OAuth</li>
82
+
83
+ </ul>
84
+ <a href="#" class="inheritanceTree">show all</a>
85
+
86
+ </dd>
87
+
88
+
89
+
90
+
91
+
92
+
93
+
94
+
95
+
96
+ <dt class="r2 last">Defined in:</dt>
97
+ <dd class="r2 last">lib/prismic/api.rb</dd>
98
+
99
+ </dl>
100
+ <div class="clear"></div>
101
+
102
+
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="#http_client-instance_method" title="#http_client (instance method)">- (Object) <strong>http_client</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>Returns the value of attribute http_client.</p>
132
+ </div></span>
133
+
134
+ </li>
135
+
136
+
137
+ <li class="public ">
138
+ <span class="summary_signature">
139
+
140
+ <a href="#initiate-instance_method" title="#initiate (instance method)">- (Object) <strong>initiate</strong> </a>
141
+
142
+
143
+
144
+ </span>
145
+
146
+
147
+
148
+
149
+ <span class="note title readonly">readonly</span>
150
+
151
+
152
+
153
+
154
+
155
+
156
+
157
+
158
+
159
+ <span class="summary_desc"><div class='inline'><p>Returns the value of attribute initiate.</p>
160
+ </div></span>
161
+
162
+ </li>
163
+
164
+
165
+ <li class="public ">
166
+ <span class="summary_signature">
167
+
168
+ <a href="#token-instance_method" title="#token (instance method)">- (Object) <strong>token</strong> </a>
169
+
170
+
171
+
172
+ </span>
173
+
174
+
175
+
176
+
177
+ <span class="note title readonly">readonly</span>
178
+
179
+
180
+
181
+
182
+
183
+
184
+
185
+
186
+
187
+ <span class="summary_desc"><div class='inline'><p>Returns the value of attribute token.</p>
188
+ </div></span>
189
+
190
+ </li>
191
+
192
+
193
+ </ul>
194
+
195
+
196
+
197
+
198
+
199
+ <h2>
200
+ Instance Method Summary
201
+ <small>(<a href="#" class="summary_toggle">collapse</a>)</small>
202
+ </h2>
203
+
204
+ <ul class="summary">
205
+
206
+ <li class="public ">
207
+ <span class="summary_signature">
208
+
209
+ <a href="#check_token-instance_method" title="#check_token (instance method)">- (Object) <strong>check_token</strong>(params) </a>
210
+
211
+
212
+
213
+ </span>
214
+
215
+
216
+
217
+
218
+
219
+
220
+
221
+
222
+
223
+ <span class="summary_desc"><div class='inline'></div></span>
224
+
225
+ </li>
226
+
227
+
228
+ <li class="public ">
229
+ <span class="summary_signature">
230
+
231
+ <a href="#initialize-instance_method" title="#initialize (instance method)">- (OAuth) <strong>initialize</strong>(initiate, token, http_client) </a>
232
+
233
+
234
+
235
+ </span>
236
+
237
+
238
+ <span class="note title constructor">constructor</span>
239
+
240
+
241
+
242
+
243
+
244
+
245
+
246
+
247
+ <span class="summary_desc"><div class='inline'><p>A new instance of OAuth.</p>
248
+ </div></span>
249
+
250
+ </li>
251
+
252
+
253
+ <li class="public ">
254
+ <span class="summary_signature">
255
+
256
+ <a href="#initiate_url-instance_method" title="#initiate_url (instance method)">- (Object) <strong>initiate_url</strong>(opts) </a>
257
+
258
+
259
+
260
+ </span>
261
+
262
+
263
+
264
+
265
+
266
+
267
+
268
+
269
+
270
+ <span class="summary_desc"><div class='inline'></div></span>
271
+
272
+ </li>
273
+
274
+
275
+ </ul>
276
+
277
+
278
+ <div id="constructor_details" class="method_details_list">
279
+ <h2>Constructor Details</h2>
280
+
281
+ <div class="method_details first">
282
+ <h3 class="signature first" id="initialize-instance_method">
283
+
284
+ - (<tt><span class='object_link'><a href="" title="Prismic::API::OAuth (class)">OAuth</a></span></tt>) <strong>initialize</strong>(initiate, token, http_client)
285
+
286
+
287
+
288
+
289
+
290
+ </h3><div class="docstring">
291
+ <div class="discussion">
292
+ <p>Returns a new instance of OAuth</p>
293
+
294
+
295
+ </div>
296
+ </div>
297
+ <div class="tags">
298
+
299
+
300
+ </div><table class="source_code">
301
+ <tr>
302
+ <td>
303
+ <pre class="lines">
304
+
305
+
306
+ 270
307
+ 271
308
+ 272
309
+ 273
310
+ 274</pre>
311
+ </td>
312
+ <td>
313
+ <pre class="code"><span class="info file"># File 'lib/prismic/api.rb', line 270</span>
314
+
315
+ <span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_initiate'>initiate</span><span class='comma'>,</span> <span class='id identifier rubyid_token'>token</span><span class='comma'>,</span> <span class='id identifier rubyid_http_client'>http_client</span><span class='rparen'>)</span>
316
+ <span class='ivar'>@http_client</span> <span class='op'>=</span> <span class='id identifier rubyid_http_client'>http_client</span>
317
+ <span class='ivar'>@initiate</span> <span class='op'>=</span> <span class='id identifier rubyid_initiate'>initiate</span>
318
+ <span class='ivar'>@token</span> <span class='op'>=</span> <span class='id identifier rubyid_token'>token</span>
319
+ <span class='kw'>end</span></pre>
320
+ </td>
321
+ </tr>
322
+ </table>
323
+ </div>
324
+
325
+ </div>
326
+
327
+ <div id="instance_attr_details" class="attr_details">
328
+ <h2>Instance Attribute Details</h2>
329
+
330
+
331
+ <span id=""></span>
332
+ <div class="method_details first">
333
+ <h3 class="signature first" id="http_client-instance_method">
334
+
335
+ - (<tt>Object</tt>) <strong>http_client</strong> <span class="extras">(readonly)</span>
336
+
337
+
338
+
339
+
340
+
341
+ </h3><div class="docstring">
342
+ <div class="discussion">
343
+ <p>Returns the value of attribute http_client</p>
344
+
345
+
346
+ </div>
347
+ </div>
348
+ <div class="tags">
349
+
350
+
351
+ </div><table class="source_code">
352
+ <tr>
353
+ <td>
354
+ <pre class="lines">
355
+
356
+
357
+ 269
358
+ 270
359
+ 271</pre>
360
+ </td>
361
+ <td>
362
+ <pre class="code"><span class="info file"># File 'lib/prismic/api.rb', line 269</span>
363
+
364
+ <span class='kw'>def</span> <span class='id identifier rubyid_http_client'>http_client</span>
365
+ <span class='ivar'>@http_client</span>
366
+ <span class='kw'>end</span></pre>
367
+ </td>
368
+ </tr>
369
+ </table>
370
+ </div>
371
+
372
+
373
+ <span id=""></span>
374
+ <div class="method_details ">
375
+ <h3 class="signature " id="initiate-instance_method">
376
+
377
+ - (<tt>Object</tt>) <strong>initiate</strong> <span class="extras">(readonly)</span>
378
+
379
+
380
+
381
+
382
+
383
+ </h3><div class="docstring">
384
+ <div class="discussion">
385
+ <p>Returns the value of attribute initiate</p>
386
+
387
+
388
+ </div>
389
+ </div>
390
+ <div class="tags">
391
+
392
+
393
+ </div><table class="source_code">
394
+ <tr>
395
+ <td>
396
+ <pre class="lines">
397
+
398
+
399
+ 269
400
+ 270
401
+ 271</pre>
402
+ </td>
403
+ <td>
404
+ <pre class="code"><span class="info file"># File 'lib/prismic/api.rb', line 269</span>
405
+
406
+ <span class='kw'>def</span> <span class='id identifier rubyid_initiate'>initiate</span>
407
+ <span class='ivar'>@initiate</span>
408
+ <span class='kw'>end</span></pre>
409
+ </td>
410
+ </tr>
411
+ </table>
412
+ </div>
413
+
414
+
415
+ <span id=""></span>
416
+ <div class="method_details ">
417
+ <h3 class="signature " id="token-instance_method">
418
+
419
+ - (<tt>Object</tt>) <strong>token</strong> <span class="extras">(readonly)</span>
420
+
421
+
422
+
423
+
424
+
425
+ </h3><div class="docstring">
426
+ <div class="discussion">
427
+ <p>Returns the value of attribute token</p>
428
+
429
+
430
+ </div>
431
+ </div>
432
+ <div class="tags">
433
+
434
+
435
+ </div><table class="source_code">
436
+ <tr>
437
+ <td>
438
+ <pre class="lines">
439
+
440
+
441
+ 269
442
+ 270
443
+ 271</pre>
444
+ </td>
445
+ <td>
446
+ <pre class="code"><span class="info file"># File 'lib/prismic/api.rb', line 269</span>
447
+
448
+ <span class='kw'>def</span> <span class='id identifier rubyid_token'>token</span>
449
+ <span class='ivar'>@token</span>
450
+ <span class='kw'>end</span></pre>
451
+ </td>
452
+ </tr>
453
+ </table>
454
+ </div>
455
+
456
+ </div>
457
+
458
+
459
+ <div id="instance_method_details" class="method_details_list">
460
+ <h2>Instance Method Details</h2>
461
+
462
+
463
+ <div class="method_details first">
464
+ <h3 class="signature first" id="check_token-instance_method">
465
+
466
+ - (<tt>Object</tt>) <strong>check_token</strong>(params)
467
+
468
+
469
+
470
+
471
+
472
+ </h3><table class="source_code">
473
+ <tr>
474
+ <td>
475
+ <pre class="lines">
476
+
477
+
478
+ 282
479
+ 283
480
+ 284
481
+ 285
482
+ 286
483
+ 287
484
+ 288
485
+ 289
486
+ 290
487
+ 291
488
+ 292
489
+ 293</pre>
490
+ </td>
491
+ <td>
492
+ <pre class="code"><span class="info file"># File 'lib/prismic/api.rb', line 282</span>
493
+
494
+ <span class='kw'>def</span> <span class='id identifier rubyid_check_token'>check_token</span><span class='lparen'>(</span><span class='id identifier rubyid_params'>params</span><span class='rparen'>)</span>
495
+ <span class='id identifier rubyid_res'>res</span> <span class='op'>=</span> <span class='id identifier rubyid_http_client'>http_client</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='id identifier rubyid_token'>token</span><span class='comma'>,</span> <span class='id identifier rubyid_params'>params</span><span class='rparen'>)</span>
496
+ <span class='kw'>if</span> <span class='id identifier rubyid_res'>res</span><span class='period'>.</span><span class='id identifier rubyid_code'>code</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>
497
+ <span class='kw'>begin</span>
498
+ <span class='const'>JSON</span><span class='period'>.</span><span class='id identifier rubyid_load'>load</span><span class='lparen'>(</span><span class='id identifier rubyid_res'>res</span><span class='period'>.</span><span class='id identifier rubyid_body'>body</span><span class='rparen'>)</span><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>
499
+ <span class='kw'>rescue</span> <span class='const'>Exception</span> <span class='op'>=&gt;</span> <span class='id identifier rubyid_e'>e</span>
500
+ <span class='id identifier rubyid_raise'>raise</span> <span class='const'>PrismicWSConnectionError</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_res'>res</span><span class='comma'>,</span> <span class='id identifier rubyid_e'>e</span><span class='rparen'>)</span>
501
+ <span class='kw'>end</span>
502
+ <span class='kw'>else</span>
503
+ <span class='id identifier rubyid_raise'>raise</span> <span class='const'>PrismicWSConnectionError</span><span class='comma'>,</span> <span class='id identifier rubyid_res'>res</span>
504
+ <span class='kw'>end</span>
505
+ <span class='kw'>end</span></pre>
506
+ </td>
507
+ </tr>
508
+ </table>
509
+ </div>
510
+
511
+ <div class="method_details ">
512
+ <h3 class="signature " id="initiate_url-instance_method">
513
+
514
+ - (<tt>Object</tt>) <strong>initiate_url</strong>(opts)
515
+
516
+
517
+
518
+
519
+
520
+ </h3><table class="source_code">
521
+ <tr>
522
+ <td>
523
+ <pre class="lines">
524
+
525
+
526
+ 275
527
+ 276
528
+ 277
529
+ 278
530
+ 279
531
+ 280
532
+ 281</pre>
533
+ </td>
534
+ <td>
535
+ <pre class="code"><span class="info file"># File 'lib/prismic/api.rb', line 275</span>
536
+
537
+ <span class='kw'>def</span> <span class='id identifier rubyid_initiate_url'>initiate_url</span><span class='lparen'>(</span><span class='id identifier rubyid_opts'>opts</span><span class='rparen'>)</span>
538
+ <span class='id identifier rubyid_initiate'>initiate</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='lbrace'>{</span>
539
+ <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>client_id</span><span class='tstring_end'>&#39;</span></span> <span class='op'>=&gt;</span> <span class='id identifier rubyid_opts'>opts</span><span class='period'>.</span><span class='id identifier rubyid_fetch'>fetch</span><span class='lparen'>(</span><span class='symbol'>:client_id</span><span class='rparen'>)</span><span class='comma'>,</span>
540
+ <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>redirect_uri</span><span class='tstring_end'>&#39;</span></span> <span class='op'>=&gt;</span> <span class='id identifier rubyid_opts'>opts</span><span class='period'>.</span><span class='id identifier rubyid_fetch'>fetch</span><span class='lparen'>(</span><span class='symbol'>:redirect_uri</span><span class='rparen'>)</span><span class='comma'>,</span>
541
+ <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>scope</span><span class='tstring_end'>&#39;</span></span> <span class='op'>=&gt;</span> <span class='id identifier rubyid_opts'>opts</span><span class='period'>.</span><span class='id identifier rubyid_fetch'>fetch</span><span class='lparen'>(</span><span class='symbol'>:scope</span><span class='rparen'>)</span><span class='comma'>,</span>
542
+ <span class='rbrace'>}</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_kv'>kv</span><span class='op'>|</span> <span class='id identifier rubyid_kv'>kv</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_e'>e</span><span class='op'>|</span> <span class='const'>CGI</span><span class='period'>.</span><span class='id identifier rubyid_escape'>escape</span><span class='lparen'>(</span><span class='id identifier rubyid_e'>e</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='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>
543
+ <span class='kw'>end</span></pre>
544
+ </td>
545
+ </tr>
546
+ </table>
547
+ </div>
548
+
549
+ </div>
550
+
551
+ </div>
552
+
553
+ <div id="footer">
554
+ Generated on Tue Sep 27 10:47:06 2016 by
555
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
556
+ 0.8.7.4 (ruby-2.0.0).
557
+ </div>
558
+
559
+ </body>
560
+ </html>