contentful 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (76) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +1 -0
  3. data/ChangeLog.md +6 -0
  4. data/Gemfile +5 -0
  5. data/README.md +1 -0
  6. data/contentful.gemspec +1 -1
  7. data/lib/contentful/array.rb +1 -2
  8. data/lib/contentful/asset.rb +3 -3
  9. data/lib/contentful/client.rb +15 -18
  10. data/lib/contentful/content_type.rb +1 -1
  11. data/lib/contentful/dynamic_entry.rb +6 -6
  12. data/lib/contentful/entry.rb +1 -1
  13. data/lib/contentful/error.rb +3 -3
  14. data/lib/contentful/field.rb +1 -1
  15. data/lib/contentful/file.rb +1 -1
  16. data/lib/contentful/link.rb +2 -2
  17. data/lib/contentful/locale.rb +1 -1
  18. data/lib/contentful/location.rb +1 -1
  19. data/lib/contentful/resource.rb +10 -11
  20. data/lib/contentful/resource_builder.rb +63 -39
  21. data/lib/contentful/space.rb +1 -1
  22. data/lib/contentful/support.rb +5 -3
  23. data/lib/contentful/version.rb +1 -1
  24. data/spec/fixtures/json_responses/includes.json +111 -0
  25. data/spec/fixtures/json_responses/link_array.json +43 -0
  26. data/spec/resource_building_spec.rb +20 -0
  27. data/spec/spec_helper.rb +5 -1
  28. metadata +138 -192
  29. data/.README.md.swp +0 -0
  30. data/do_request.sh +0 -5
  31. data/doc/Contentful.html +0 -131
  32. data/doc/Contentful/AccessDenied.html +0 -158
  33. data/doc/Contentful/Array.html +0 -346
  34. data/doc/Contentful/Asset.html +0 -315
  35. data/doc/Contentful/BadRequest.html +0 -158
  36. data/doc/Contentful/Client.html +0 -1407
  37. data/doc/Contentful/ContentType.html +0 -183
  38. data/doc/Contentful/DynamicEntry.html +0 -333
  39. data/doc/Contentful/Entry.html +0 -198
  40. data/doc/Contentful/Error.html +0 -413
  41. data/doc/Contentful/Field.html +0 -161
  42. data/doc/Contentful/File.html +0 -160
  43. data/doc/Contentful/Link.html +0 -275
  44. data/doc/Contentful/Locale.html +0 -161
  45. data/doc/Contentful/NotFound.html +0 -158
  46. data/doc/Contentful/Request.html +0 -669
  47. data/doc/Contentful/Resource.html +0 -606
  48. data/doc/Contentful/Resource/AssetFields.html +0 -413
  49. data/doc/Contentful/Resource/AssetFields/ClassMethods.html +0 -174
  50. data/doc/Contentful/Resource/ClassMethods.html +0 -271
  51. data/doc/Contentful/Resource/Fields.html +0 -398
  52. data/doc/Contentful/Resource/Fields/ClassMethods.html +0 -187
  53. data/doc/Contentful/Resource/SystemProperties.html +0 -444
  54. data/doc/Contentful/Resource/SystemProperties/ClassMethods.html +0 -174
  55. data/doc/Contentful/ResourceBuilder.html +0 -1400
  56. data/doc/Contentful/Response.html +0 -546
  57. data/doc/Contentful/ServerError.html +0 -158
  58. data/doc/Contentful/Space.html +0 -183
  59. data/doc/Contentful/Support.html +0 -198
  60. data/doc/Contentful/Unauthorized.html +0 -158
  61. data/doc/Contentful/UnparsableJson.html +0 -158
  62. data/doc/Contentful/UnparsableResource.html +0 -158
  63. data/doc/_index.html +0 -410
  64. data/doc/class_list.html +0 -54
  65. data/doc/css/common.css +0 -1
  66. data/doc/css/full_list.css +0 -57
  67. data/doc/css/style.css +0 -338
  68. data/doc/file.README.html +0 -214
  69. data/doc/file_list.html +0 -56
  70. data/doc/frames.html +0 -26
  71. data/doc/index.html +0 -214
  72. data/doc/js/app.js +0 -219
  73. data/doc/js/full_list.js +0 -178
  74. data/doc/js/jquery.js +0 -4
  75. data/doc/method_list.html +0 -533
  76. data/doc/top-level-namespace.html +0 -112
@@ -1,546 +0,0 @@
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: Contentful::Response
8
-
9
- &mdash; Documentation by YARD 0.8.7.3
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#!" + escape(window.location.href);
21
- </script>
22
-
23
-
24
- <script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
25
-
26
- <script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
27
-
28
-
29
- </head>
30
- <body>
31
- <div id="header">
32
- <div id="menu">
33
-
34
- <a href="../_index.html">Index (R)</a> &raquo;
35
- <span class='title'><span class='object_link'><a href="../Contentful.html" title="Contentful (module)">Contentful</a></span></span>
36
- &raquo;
37
- <span class="title">Response</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: Contentful::Response
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">Contentful::Response</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/contentful/response.rb</dd>
98
-
99
- </dl>
100
- <div class="clear"></div>
101
-
102
- <h2>Overview</h2><div class="docstring">
103
- <div class="discussion">
104
-
105
- <p>An object representing an answer by the contentful service. It is later
106
- used to build a Resource, which is done by the ResourceBuilder.</p>
107
-
108
- <p>The Response parses the http response (as returned by the underlying http
109
- library) to a JSON object. Responses can be asked the following methods:</p>
110
- <ul><li>
111
- <p>#raw (raw HTTP response by the HTTP library)</p>
112
- </li><li>
113
- <p>#object (the parsed JSON object)</p>
114
- </li></ul>
115
-
116
- <p>It also sets a #status which can be one of:</p>
117
- <ul><li>
118
- <p>:ok (seems to be a valid resource object)</p>
119
- </li><li>
120
- <p>:contentful_error (valid error object)</p>
121
- </li><li>
122
- <p>:not_contentful (valid json, but missing the contentful's sys property)</p>
123
- </li><li>
124
- <p>:unparsable_json (invalid json)</p>
125
- </li></ul>
126
-
127
- <p>Error Repsonses also contain a:</p>
128
- <ul><li>
129
- <p>:error_message</p>
130
- </li></ul>
131
-
132
-
133
- </div>
134
- </div>
135
- <div class="tags">
136
-
137
-
138
- </div>
139
-
140
-
141
-
142
- <h2>Instance Attribute Summary <small>(<a href="#" class="summary_toggle">collapse</a>)</small></h2>
143
- <ul class="summary">
144
-
145
- <li class="public ">
146
- <span class="summary_signature">
147
-
148
- <a href="#error_message-instance_method" title="#error_message (instance method)">- (Object) <strong>error_message</strong> </a>
149
-
150
-
151
-
152
- </span>
153
-
154
-
155
-
156
-
157
- <span class="note title readonly">readonly</span>
158
-
159
-
160
-
161
-
162
-
163
-
164
-
165
-
166
-
167
- <span class="summary_desc"><div class='inline'>
168
- <p>Returns the value of attribute error_message.</p>
169
- </div></span>
170
-
171
- </li>
172
-
173
-
174
- <li class="public ">
175
- <span class="summary_signature">
176
-
177
- <a href="#object-instance_method" title="#object (instance method)">- (Object) <strong>object</strong> </a>
178
-
179
-
180
-
181
- </span>
182
-
183
-
184
-
185
-
186
- <span class="note title readonly">readonly</span>
187
-
188
-
189
-
190
-
191
-
192
-
193
-
194
-
195
-
196
- <span class="summary_desc"><div class='inline'>
197
- <p>Returns the value of attribute object.</p>
198
- </div></span>
199
-
200
- </li>
201
-
202
-
203
- <li class="public ">
204
- <span class="summary_signature">
205
-
206
- <a href="#raw-instance_method" title="#raw (instance method)">- (Object) <strong>raw</strong> </a>
207
-
208
-
209
-
210
- </span>
211
-
212
-
213
-
214
-
215
- <span class="note title readonly">readonly</span>
216
-
217
-
218
-
219
-
220
-
221
-
222
-
223
-
224
-
225
- <span class="summary_desc"><div class='inline'>
226
- <p>Returns the value of attribute raw.</p>
227
- </div></span>
228
-
229
- </li>
230
-
231
-
232
- <li class="public ">
233
- <span class="summary_signature">
234
-
235
- <a href="#status-instance_method" title="#status (instance method)">- (Object) <strong>status</strong> </a>
236
-
237
-
238
-
239
- </span>
240
-
241
-
242
-
243
-
244
- <span class="note title readonly">readonly</span>
245
-
246
-
247
-
248
-
249
-
250
-
251
-
252
-
253
-
254
- <span class="summary_desc"><div class='inline'>
255
- <p>Returns the value of attribute status.</p>
256
- </div></span>
257
-
258
- </li>
259
-
260
-
261
- </ul>
262
-
263
-
264
-
265
-
266
-
267
- <h2>
268
- Instance Method Summary
269
- <small>(<a href="#" class="summary_toggle">collapse</a>)</small>
270
- </h2>
271
-
272
- <ul class="summary">
273
-
274
- <li class="public ">
275
- <span class="summary_signature">
276
-
277
- <a href="#initialize-instance_method" title="#initialize (instance method)">- (Response) <strong>initialize</strong>(raw) </a>
278
-
279
-
280
-
281
- </span>
282
-
283
-
284
- <span class="note title constructor">constructor</span>
285
-
286
-
287
-
288
-
289
-
290
-
291
-
292
-
293
- <span class="summary_desc"><div class='inline'>
294
- <p>A new instance of Response.</p>
295
- </div></span>
296
-
297
- </li>
298
-
299
-
300
- </ul>
301
-
302
-
303
- <div id="constructor_details" class="method_details_list">
304
- <h2>Constructor Details</h2>
305
-
306
- <div class="method_details first">
307
- <h3 class="signature first" id="initialize-instance_method">
308
-
309
- - (<tt><span class='object_link'><a href="" title="Contentful::Response (class)">Response</a></span></tt>) <strong>initialize</strong>(raw)
310
-
311
-
312
-
313
-
314
-
315
- </h3><div class="docstring">
316
- <div class="discussion">
317
-
318
- <p>Returns a new instance of Response</p>
319
-
320
-
321
- </div>
322
- </div>
323
- <div class="tags">
324
-
325
-
326
- </div><table class="source_code">
327
- <tr>
328
- <td>
329
- <pre class="lines">
330
-
331
-
332
- 24
333
- 25
334
- 26
335
- 27
336
- 28
337
- 29
338
- 30
339
- 31</pre>
340
- </td>
341
- <td>
342
- <pre class="code"><span class="info file"># File 'lib/contentful/response.rb', line 24</span>
343
-
344
- <span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_raw'>raw</span><span class='rparen'>)</span>
345
- <span class='ivar'>@raw</span> <span class='op'>=</span> <span class='id identifier rubyid_raw'>raw</span>
346
- <span class='ivar'>@status</span> <span class='op'>=</span> <span class='symbol'>:ok</span>
347
-
348
- <span class='kw'>if</span> <span class='id identifier rubyid_parse_json!'>parse_json!</span>
349
- <span class='id identifier rubyid_parse_contentful_error!'>parse_contentful_error!</span>
350
- <span class='kw'>end</span>
351
- <span class='kw'>end</span></pre>
352
- </td>
353
- </tr>
354
- </table>
355
- </div>
356
-
357
- </div>
358
-
359
- <div id="instance_attr_details" class="attr_details">
360
- <h2>Instance Attribute Details</h2>
361
-
362
-
363
- <span id=""></span>
364
- <div class="method_details first">
365
- <h3 class="signature first" id="error_message-instance_method">
366
-
367
- - (<tt>Object</tt>) <strong>error_message</strong> <span class="extras">(readonly)</span>
368
-
369
-
370
-
371
-
372
-
373
- </h3><div class="docstring">
374
- <div class="discussion">
375
-
376
- <p>Returns the value of attribute error_message</p>
377
-
378
-
379
- </div>
380
- </div>
381
- <div class="tags">
382
-
383
-
384
- </div><table class="source_code">
385
- <tr>
386
- <td>
387
- <pre class="lines">
388
-
389
-
390
- 22
391
- 23
392
- 24</pre>
393
- </td>
394
- <td>
395
- <pre class="code"><span class="info file"># File 'lib/contentful/response.rb', line 22</span>
396
-
397
- <span class='kw'>def</span> <span class='id identifier rubyid_error_message'>error_message</span>
398
- <span class='ivar'>@error_message</span>
399
- <span class='kw'>end</span></pre>
400
- </td>
401
- </tr>
402
- </table>
403
- </div>
404
-
405
-
406
- <span id=""></span>
407
- <div class="method_details ">
408
- <h3 class="signature " id="object-instance_method">
409
-
410
- - (<tt>Object</tt>) <strong>object</strong> <span class="extras">(readonly)</span>
411
-
412
-
413
-
414
-
415
-
416
- </h3><div class="docstring">
417
- <div class="discussion">
418
-
419
- <p>Returns the value of attribute object</p>
420
-
421
-
422
- </div>
423
- </div>
424
- <div class="tags">
425
-
426
-
427
- </div><table class="source_code">
428
- <tr>
429
- <td>
430
- <pre class="lines">
431
-
432
-
433
- 22
434
- 23
435
- 24</pre>
436
- </td>
437
- <td>
438
- <pre class="code"><span class="info file"># File 'lib/contentful/response.rb', line 22</span>
439
-
440
- <span class='kw'>def</span> <span class='id identifier rubyid_object'>object</span>
441
- <span class='ivar'>@object</span>
442
- <span class='kw'>end</span></pre>
443
- </td>
444
- </tr>
445
- </table>
446
- </div>
447
-
448
-
449
- <span id=""></span>
450
- <div class="method_details ">
451
- <h3 class="signature " id="raw-instance_method">
452
-
453
- - (<tt>Object</tt>) <strong>raw</strong> <span class="extras">(readonly)</span>
454
-
455
-
456
-
457
-
458
-
459
- </h3><div class="docstring">
460
- <div class="discussion">
461
-
462
- <p>Returns the value of attribute raw</p>
463
-
464
-
465
- </div>
466
- </div>
467
- <div class="tags">
468
-
469
-
470
- </div><table class="source_code">
471
- <tr>
472
- <td>
473
- <pre class="lines">
474
-
475
-
476
- 22
477
- 23
478
- 24</pre>
479
- </td>
480
- <td>
481
- <pre class="code"><span class="info file"># File 'lib/contentful/response.rb', line 22</span>
482
-
483
- <span class='kw'>def</span> <span class='id identifier rubyid_raw'>raw</span>
484
- <span class='ivar'>@raw</span>
485
- <span class='kw'>end</span></pre>
486
- </td>
487
- </tr>
488
- </table>
489
- </div>
490
-
491
-
492
- <span id=""></span>
493
- <div class="method_details ">
494
- <h3 class="signature " id="status-instance_method">
495
-
496
- - (<tt>Object</tt>) <strong>status</strong> <span class="extras">(readonly)</span>
497
-
498
-
499
-
500
-
501
-
502
- </h3><div class="docstring">
503
- <div class="discussion">
504
-
505
- <p>Returns the value of attribute status</p>
506
-
507
-
508
- </div>
509
- </div>
510
- <div class="tags">
511
-
512
-
513
- </div><table class="source_code">
514
- <tr>
515
- <td>
516
- <pre class="lines">
517
-
518
-
519
- 22
520
- 23
521
- 24</pre>
522
- </td>
523
- <td>
524
- <pre class="code"><span class="info file"># File 'lib/contentful/response.rb', line 22</span>
525
-
526
- <span class='kw'>def</span> <span class='id identifier rubyid_status'>status</span>
527
- <span class='ivar'>@status</span>
528
- <span class='kw'>end</span></pre>
529
- </td>
530
- </tr>
531
- </table>
532
- </div>
533
-
534
- </div>
535
-
536
-
537
- </div>
538
-
539
- <div id="footer">
540
- Generated on Tue Mar 11 09:25:53 2014 by
541
- <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
542
- 0.8.7.3 (ruby-1.9.3).
543
- </div>
544
-
545
- </body>
546
- </html>