contentful 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (133) hide show
  1. data/.README.md.swp +0 -0
  2. data/.gitignore +2 -0
  3. data/.rspec +1 -0
  4. data/.travis.yml +10 -0
  5. data/ChangeLog.md +3 -0
  6. data/Gemfile +3 -0
  7. data/LICENSE.txt +21 -0
  8. data/README.md +193 -0
  9. data/Rakefile +30 -0
  10. data/contentful.gemspec +31 -0
  11. data/do_request.sh +5 -0
  12. data/doc/Contentful.html +131 -0
  13. data/doc/Contentful/AccessDenied.html +158 -0
  14. data/doc/Contentful/Array.html +346 -0
  15. data/doc/Contentful/Asset.html +315 -0
  16. data/doc/Contentful/BadRequest.html +158 -0
  17. data/doc/Contentful/Client.html +1407 -0
  18. data/doc/Contentful/ContentType.html +183 -0
  19. data/doc/Contentful/DynamicEntry.html +333 -0
  20. data/doc/Contentful/Entry.html +198 -0
  21. data/doc/Contentful/Error.html +413 -0
  22. data/doc/Contentful/Field.html +161 -0
  23. data/doc/Contentful/File.html +160 -0
  24. data/doc/Contentful/Link.html +275 -0
  25. data/doc/Contentful/Locale.html +161 -0
  26. data/doc/Contentful/NotFound.html +158 -0
  27. data/doc/Contentful/Request.html +669 -0
  28. data/doc/Contentful/Resource.html +606 -0
  29. data/doc/Contentful/Resource/AssetFields.html +413 -0
  30. data/doc/Contentful/Resource/AssetFields/ClassMethods.html +174 -0
  31. data/doc/Contentful/Resource/ClassMethods.html +271 -0
  32. data/doc/Contentful/Resource/Fields.html +398 -0
  33. data/doc/Contentful/Resource/Fields/ClassMethods.html +187 -0
  34. data/doc/Contentful/Resource/SystemProperties.html +444 -0
  35. data/doc/Contentful/Resource/SystemProperties/ClassMethods.html +174 -0
  36. data/doc/Contentful/ResourceBuilder.html +1400 -0
  37. data/doc/Contentful/Response.html +546 -0
  38. data/doc/Contentful/ServerError.html +158 -0
  39. data/doc/Contentful/Space.html +183 -0
  40. data/doc/Contentful/Support.html +198 -0
  41. data/doc/Contentful/Unauthorized.html +158 -0
  42. data/doc/Contentful/UnparsableJson.html +158 -0
  43. data/doc/Contentful/UnparsableResource.html +158 -0
  44. data/doc/_index.html +410 -0
  45. data/doc/class_list.html +54 -0
  46. data/doc/css/common.css +1 -0
  47. data/doc/css/full_list.css +57 -0
  48. data/doc/css/style.css +338 -0
  49. data/doc/file.README.html +214 -0
  50. data/doc/file_list.html +56 -0
  51. data/doc/frames.html +26 -0
  52. data/doc/index.html +214 -0
  53. data/doc/js/app.js +219 -0
  54. data/doc/js/full_list.js +178 -0
  55. data/doc/js/jquery.js +4 -0
  56. data/doc/method_list.html +533 -0
  57. data/doc/top-level-namespace.html +112 -0
  58. data/examples/custom_classes.rb +43 -0
  59. data/examples/dynamic_entries.rb +126 -0
  60. data/examples/example_queries.rb +27 -0
  61. data/examples/raise_errors.rb +22 -0
  62. data/examples/raw_mode.rb +15 -0
  63. data/examples/resource_mapping.rb +33 -0
  64. data/lib/contentful.rb +3 -0
  65. data/lib/contentful/array.rb +47 -0
  66. data/lib/contentful/asset.rb +34 -0
  67. data/lib/contentful/client.rb +193 -0
  68. data/lib/contentful/content_type.rb +16 -0
  69. data/lib/contentful/dynamic_entry.rb +54 -0
  70. data/lib/contentful/entry.rb +12 -0
  71. data/lib/contentful/error.rb +52 -0
  72. data/lib/contentful/field.rb +16 -0
  73. data/lib/contentful/file.rb +13 -0
  74. data/lib/contentful/link.rb +20 -0
  75. data/lib/contentful/locale.rb +12 -0
  76. data/lib/contentful/location.rb +12 -0
  77. data/lib/contentful/request.rb +37 -0
  78. data/lib/contentful/resource.rb +146 -0
  79. data/lib/contentful/resource/asset_fields.rb +50 -0
  80. data/lib/contentful/resource/fields.rb +39 -0
  81. data/lib/contentful/resource/system_properties.rb +48 -0
  82. data/lib/contentful/resource_builder.rb +197 -0
  83. data/lib/contentful/response.rb +64 -0
  84. data/lib/contentful/space.rb +14 -0
  85. data/lib/contentful/support.rb +18 -0
  86. data/lib/contentful/version.rb +3 -0
  87. data/spec/array_spec.rb +69 -0
  88. data/spec/asset_spec.rb +62 -0
  89. data/spec/auto_includes_spec.rb +12 -0
  90. data/spec/client_class_spec.rb +59 -0
  91. data/spec/client_configuration_spec.rb +197 -0
  92. data/spec/coercions_spec.rb +10 -0
  93. data/spec/content_type_spec.rb +44 -0
  94. data/spec/dynamic_entry_spec.rb +34 -0
  95. data/spec/entry_spec.rb +53 -0
  96. data/spec/error_class_spec.rb +60 -0
  97. data/spec/error_requests_spec.rb +32 -0
  98. data/spec/field_spec.rb +36 -0
  99. data/spec/file_spec.rb +28 -0
  100. data/spec/fixtures/json_responses/content_type.json +83 -0
  101. data/spec/fixtures/json_responses/not_found.json +13 -0
  102. data/spec/fixtures/json_responses/nyancat.json +48 -0
  103. data/spec/fixtures/json_responses/unparsable.json +13 -0
  104. data/spec/fixtures/vcr_cassettes/array.yml +288 -0
  105. data/spec/fixtures/vcr_cassettes/array_page_1.yml +106 -0
  106. data/spec/fixtures/vcr_cassettes/array_page_2.yml +73 -0
  107. data/spec/fixtures/vcr_cassettes/asset.yml +96 -0
  108. data/spec/fixtures/vcr_cassettes/bad_request.yml +76 -0
  109. data/spec/fixtures/vcr_cassettes/content_type.yml +147 -0
  110. data/spec/fixtures/vcr_cassettes/entries.yml +561 -0
  111. data/spec/fixtures/vcr_cassettes/entry.yml +112 -0
  112. data/spec/fixtures/vcr_cassettes/entry_cache.yml +288 -0
  113. data/spec/fixtures/vcr_cassettes/field.yml +147 -0
  114. data/spec/fixtures/vcr_cassettes/locale.yml +81 -0
  115. data/spec/fixtures/vcr_cassettes/location.yml +305 -0
  116. data/spec/fixtures/vcr_cassettes/not_found.yml +71 -0
  117. data/spec/fixtures/vcr_cassettes/nyancat.yml +112 -0
  118. data/spec/fixtures/vcr_cassettes/nyancat_include.yml +112 -0
  119. data/spec/fixtures/vcr_cassettes/reloaded_entry.yml +112 -0
  120. data/spec/fixtures/vcr_cassettes/space.yml +81 -0
  121. data/spec/fixtures/vcr_cassettes/unauthorized.yml +64 -0
  122. data/spec/link_spec.rb +40 -0
  123. data/spec/locale_spec.rb +20 -0
  124. data/spec/location_spec.rb +30 -0
  125. data/spec/request_spec.rb +48 -0
  126. data/spec/resource_spec.rb +52 -0
  127. data/spec/response_spec.rb +50 -0
  128. data/spec/space_spec.rb +36 -0
  129. data/spec/spec_helper.rb +6 -0
  130. data/spec/support/client.rb +6 -0
  131. data/spec/support/json_responses.rb +11 -0
  132. data/spec/support/vcr.rb +16 -0
  133. metadata +374 -0
@@ -0,0 +1,1407 @@
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::Client
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 (C)</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">Client</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::Client
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::Client</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/client.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>The client object is initialized with a space and a key and then used for
106
+ querying resources from this space. See README for details</p>
107
+
108
+
109
+ </div>
110
+ </div>
111
+ <div class="tags">
112
+
113
+
114
+ </div>
115
+ <h2>Constant Summary</h2>
116
+
117
+ <dl class="constants">
118
+
119
+ <dt id="DEFAULT_CONFIGURATION-constant" class="">DEFAULT_CONFIGURATION =
120
+
121
+ </dt>
122
+ <dd><pre class="code"><span class='lbrace'>{</span>
123
+ <span class='label'>secure:</span> <span class='kw'>true</span><span class='comma'>,</span>
124
+ <span class='label'>raise_errors:</span> <span class='kw'>true</span><span class='comma'>,</span>
125
+ <span class='label'>dynamic_entries:</span> <span class='kw'>false</span><span class='comma'>,</span>
126
+ <span class='label'>api_url:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>cdn.contentful.com</span><span class='tstring_end'>'</span></span><span class='comma'>,</span>
127
+ <span class='label'>api_version:</span> <span class='int'>1</span><span class='comma'>,</span>
128
+ <span class='label'>authentication_mechanism:</span> <span class='symbol'>:header</span><span class='comma'>,</span>
129
+ <span class='label'>resource_builder:</span> <span class='const'>ResourceBuilder</span><span class='comma'>,</span>
130
+ <span class='label'>raw_mode:</span> <span class='kw'>false</span><span class='comma'>,</span>
131
+ <span class='rbrace'>}</span></pre></dd>
132
+
133
+ </dl>
134
+
135
+
136
+
137
+
138
+
139
+ <h2>Instance Attribute Summary <small>(<a href="#" class="summary_toggle">collapse</a>)</small></h2>
140
+ <ul class="summary">
141
+
142
+ <li class="public ">
143
+ <span class="summary_signature">
144
+
145
+ <a href="#configuration-instance_method" title="#configuration (instance method)">- (Object) <strong>configuration</strong> </a>
146
+
147
+
148
+
149
+ </span>
150
+
151
+
152
+
153
+
154
+ <span class="note title readonly">readonly</span>
155
+
156
+
157
+
158
+
159
+
160
+
161
+
162
+
163
+
164
+ <span class="summary_desc"><div class='inline'>
165
+ <p>Returns the value of attribute configuration.</p>
166
+ </div></span>
167
+
168
+ </li>
169
+
170
+
171
+ <li class="public ">
172
+ <span class="summary_signature">
173
+
174
+ <a href="#dynamic_entry_cache-instance_method" title="#dynamic_entry_cache (instance method)">- (Object) <strong>dynamic_entry_cache</strong> </a>
175
+
176
+
177
+
178
+ </span>
179
+
180
+
181
+
182
+
183
+ <span class="note title readonly">readonly</span>
184
+
185
+
186
+
187
+
188
+
189
+
190
+
191
+
192
+
193
+ <span class="summary_desc"><div class='inline'>
194
+ <p>Returns the value of attribute dynamic_entry_cache.</p>
195
+ </div></span>
196
+
197
+ </li>
198
+
199
+
200
+ </ul>
201
+
202
+
203
+
204
+
205
+
206
+ <h2>
207
+ Class Method Summary
208
+ <small>(<a href="#" class="summary_toggle">collapse</a>)</small>
209
+ </h2>
210
+
211
+ <ul class="summary">
212
+
213
+ <li class="public ">
214
+ <span class="summary_signature">
215
+
216
+ <a href="#get_http-class_method" title="get_http (class method)">+ (Object) <strong>get_http</strong>(url, query, headers = {}) </a>
217
+
218
+
219
+
220
+ </span>
221
+
222
+
223
+
224
+
225
+
226
+
227
+
228
+
229
+
230
+ <span class="summary_desc"><div class='inline'>
231
+ <p>Wraps the actual HTTP request.</p>
232
+ </div></span>
233
+
234
+ </li>
235
+
236
+
237
+ </ul>
238
+
239
+ <h2>
240
+ Instance Method Summary
241
+ <small>(<a href="#" class="summary_toggle">collapse</a>)</small>
242
+ </h2>
243
+
244
+ <ul class="summary">
245
+
246
+ <li class="public ">
247
+ <span class="summary_signature">
248
+
249
+ <a href="#asset-instance_method" title="#asset (instance method)">- (Object) <strong>asset</strong>(id, query = {}) </a>
250
+
251
+
252
+
253
+ </span>
254
+
255
+
256
+
257
+
258
+
259
+
260
+
261
+
262
+
263
+ <span class="summary_desc"><div class='inline'>
264
+ <p>Gets a specific asset Takes an id and an optional hash of query options
265
+ Returns a Contentful::Asset.</p>
266
+ </div></span>
267
+
268
+ </li>
269
+
270
+
271
+ <li class="public ">
272
+ <span class="summary_signature">
273
+
274
+ <a href="#assets-instance_method" title="#assets (instance method)">- (Object) <strong>assets</strong>(query = {}) </a>
275
+
276
+
277
+
278
+ </span>
279
+
280
+
281
+
282
+
283
+
284
+
285
+
286
+
287
+
288
+ <span class="summary_desc"><div class='inline'>
289
+ <p>Gets a collection of assets Takes an optional hash of query options Returns
290
+ a Contentful::Array of Contentful::Asset.</p>
291
+ </div></span>
292
+
293
+ </li>
294
+
295
+
296
+ <li class="public ">
297
+ <span class="summary_signature">
298
+
299
+ <a href="#base_url-instance_method" title="#base_url (instance method)">- (Object) <strong>base_url</strong> </a>
300
+
301
+
302
+
303
+ </span>
304
+
305
+
306
+
307
+
308
+
309
+
310
+
311
+
312
+
313
+ <span class="summary_desc"><div class='inline'>
314
+ <p>Returns the base url for all of the client's requests.</p>
315
+ </div></span>
316
+
317
+ </li>
318
+
319
+
320
+ <li class="public ">
321
+ <span class="summary_signature">
322
+
323
+ <a href="#content_type-instance_method" title="#content_type (instance method)">- (Object) <strong>content_type</strong>(id, query = {}) </a>
324
+
325
+
326
+
327
+ </span>
328
+
329
+
330
+
331
+
332
+
333
+
334
+
335
+
336
+
337
+ <span class="summary_desc"><div class='inline'>
338
+ <p>Gets a specific content type Takes an id and an optional hash of query
339
+ options Returns a Contentful::ContentType.</p>
340
+ </div></span>
341
+
342
+ </li>
343
+
344
+
345
+ <li class="public ">
346
+ <span class="summary_signature">
347
+
348
+ <a href="#content_types-instance_method" title="#content_types (instance method)">- (Object) <strong>content_types</strong>(query = {}) </a>
349
+
350
+
351
+
352
+ </span>
353
+
354
+
355
+
356
+
357
+
358
+
359
+
360
+
361
+
362
+ <span class="summary_desc"><div class='inline'>
363
+ <p>Gets a collection of content types Takes an optional hash of query options
364
+ Returns a Contentful::Array of Contentful::ContentType.</p>
365
+ </div></span>
366
+
367
+ </li>
368
+
369
+
370
+ <li class="public ">
371
+ <span class="summary_signature">
372
+
373
+ <a href="#default_configuration-instance_method" title="#default_configuration (instance method)">- (Object) <strong>default_configuration</strong> </a>
374
+
375
+
376
+
377
+ </span>
378
+
379
+
380
+
381
+
382
+
383
+
384
+
385
+
386
+
387
+ <span class="summary_desc"><div class='inline'>
388
+ <p>Returns the default configuration.</p>
389
+ </div></span>
390
+
391
+ </li>
392
+
393
+
394
+ <li class="public ">
395
+ <span class="summary_signature">
396
+
397
+ <a href="#entries-instance_method" title="#entries (instance method)">- (Object) <strong>entries</strong>(query = {}) </a>
398
+
399
+
400
+
401
+ </span>
402
+
403
+
404
+
405
+
406
+
407
+
408
+
409
+
410
+
411
+ <span class="summary_desc"><div class='inline'>
412
+ <p>Gets a collection of entries Takes an optional hash of query options
413
+ Returns a Contentful::Array of Contentful::Entry.</p>
414
+ </div></span>
415
+
416
+ </li>
417
+
418
+
419
+ <li class="public ">
420
+ <span class="summary_signature">
421
+
422
+ <a href="#entry-instance_method" title="#entry (instance method)">- (Object) <strong>entry</strong>(id, query = {}) </a>
423
+
424
+
425
+
426
+ </span>
427
+
428
+
429
+
430
+
431
+
432
+
433
+
434
+
435
+
436
+ <span class="summary_desc"><div class='inline'>
437
+ <p>Gets a specific entry Takes an id and an optional hash of query options
438
+ Returns a Contentful::Entry.</p>
439
+ </div></span>
440
+
441
+ </li>
442
+
443
+
444
+ <li class="public ">
445
+ <span class="summary_signature">
446
+
447
+ <a href="#get-instance_method" title="#get (instance method)">- (Object) <strong>get</strong>(request, build_resource = true) </a>
448
+
449
+
450
+
451
+ </span>
452
+
453
+
454
+
455
+
456
+
457
+
458
+
459
+
460
+
461
+ <span class="summary_desc"><div class='inline'>
462
+ <p>Get a Contentful::Request object Set second parameter to false to
463
+ deactivate Resource building and return Response objects instead.</p>
464
+ </div></span>
465
+
466
+ </li>
467
+
468
+
469
+ <li class="public ">
470
+ <span class="summary_signature">
471
+
472
+ <a href="#initialize-instance_method" title="#initialize (instance method)">- (Client) <strong>initialize</strong>(given_configuration = {}) </a>
473
+
474
+
475
+
476
+ </span>
477
+
478
+
479
+ <span class="note title constructor">constructor</span>
480
+
481
+
482
+
483
+
484
+
485
+
486
+
487
+
488
+ <span class="summary_desc"><div class='inline'>
489
+ <p>A new instance of Client.</p>
490
+ </div></span>
491
+
492
+ </li>
493
+
494
+
495
+ <li class="public ">
496
+ <span class="summary_signature">
497
+
498
+ <a href="#request_headers-instance_method" title="#request_headers (instance method)">- (Object) <strong>request_headers</strong> </a>
499
+
500
+
501
+
502
+ </span>
503
+
504
+
505
+
506
+
507
+
508
+
509
+
510
+
511
+
512
+ <span class="summary_desc"><div class='inline'>
513
+ <p>Returns the headers used for the HTTP requests.</p>
514
+ </div></span>
515
+
516
+ </li>
517
+
518
+
519
+ <li class="public ">
520
+ <span class="summary_signature">
521
+
522
+ <a href="#request_query-instance_method" title="#request_query (instance method)">- (Object) <strong>request_query</strong>(query) </a>
523
+
524
+
525
+
526
+ </span>
527
+
528
+
529
+
530
+
531
+
532
+
533
+
534
+
535
+
536
+ <span class="summary_desc"><div class='inline'>
537
+ <p>Patches a query hash with the client configurations for queries.</p>
538
+ </div></span>
539
+
540
+ </li>
541
+
542
+
543
+ <li class="public ">
544
+ <span class="summary_signature">
545
+
546
+ <a href="#space-instance_method" title="#space (instance method)">- (Object) <strong>space</strong>(query = {}) </a>
547
+
548
+
549
+
550
+ </span>
551
+
552
+
553
+
554
+
555
+
556
+
557
+
558
+
559
+
560
+ <span class="summary_desc"><div class='inline'>
561
+ <p>Gets the client's space Takes an optional hash of query options Returns a
562
+ Contentful::Space.</p>
563
+ </div></span>
564
+
565
+ </li>
566
+
567
+
568
+ <li class="public ">
569
+ <span class="summary_signature">
570
+
571
+ <a href="#update_dynamic_entry_cache%21-instance_method" title="#update_dynamic_entry_cache! (instance method)">- (Object) <strong>update_dynamic_entry_cache!</strong> </a>
572
+
573
+
574
+
575
+ </span>
576
+
577
+
578
+
579
+
580
+
581
+
582
+
583
+
584
+
585
+ <span class="summary_desc"><div class='inline'>
586
+ <p>Use this method together with the client's :dynamic_entries configuration.</p>
587
+ </div></span>
588
+
589
+ </li>
590
+
591
+
592
+ </ul>
593
+
594
+
595
+ <div id="constructor_details" class="method_details_list">
596
+ <h2>Constructor Details</h2>
597
+
598
+ <div class="method_details first">
599
+ <h3 class="signature first" id="initialize-instance_method">
600
+
601
+ - (<tt><span class='object_link'><a href="" title="Contentful::Client (class)">Client</a></span></tt>) <strong>initialize</strong>(given_configuration = {})
602
+
603
+
604
+
605
+
606
+
607
+ </h3><div class="docstring">
608
+ <div class="discussion">
609
+
610
+ <p>Returns a new instance of Client</p>
611
+
612
+
613
+ </div>
614
+ </div>
615
+ <div class="tags">
616
+
617
+
618
+ </div><table class="source_code">
619
+ <tr>
620
+ <td>
621
+ <pre class="lines">
622
+
623
+
624
+ 30
625
+ 31
626
+ 32
627
+ 33
628
+ 34
629
+ 35
630
+ 36
631
+ 37
632
+ 38
633
+ 39
634
+ 40</pre>
635
+ </td>
636
+ <td>
637
+ <pre class="code"><span class="info file"># File 'lib/contentful/client.rb', line 30</span>
638
+
639
+ <span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_given_configuration'>given_configuration</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
640
+ <span class='ivar'>@configuration</span> <span class='op'>=</span> <span class='id identifier rubyid_default_configuration'>default_configuration</span><span class='period'>.</span><span class='id identifier rubyid_merge'>merge</span><span class='lparen'>(</span><span class='id identifier rubyid_given_configuration'>given_configuration</span><span class='rparen'>)</span>
641
+ <span class='id identifier rubyid_normalize_configuration!'>normalize_configuration!</span>
642
+ <span class='id identifier rubyid_validate_configuration!'>validate_configuration!</span>
643
+
644
+ <span class='kw'>if</span> <span class='id identifier rubyid_configuration'>configuration</span><span class='lbracket'>[</span><span class='symbol'>:dynamic_entries</span><span class='rbracket'>]</span> <span class='op'>==</span> <span class='symbol'>:auto</span>
645
+ <span class='id identifier rubyid_update_dynamic_entry_cache!'>update_dynamic_entry_cache!</span>
646
+ <span class='kw'>else</span>
647
+ <span class='ivar'>@dynamic_entry_cache</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
648
+ <span class='kw'>end</span>
649
+ <span class='kw'>end</span></pre>
650
+ </td>
651
+ </tr>
652
+ </table>
653
+ </div>
654
+
655
+ </div>
656
+
657
+ <div id="instance_attr_details" class="attr_details">
658
+ <h2>Instance Attribute Details</h2>
659
+
660
+
661
+ <span id=""></span>
662
+ <div class="method_details first">
663
+ <h3 class="signature first" id="configuration-instance_method">
664
+
665
+ - (<tt>Object</tt>) <strong>configuration</strong> <span class="extras">(readonly)</span>
666
+
667
+
668
+
669
+
670
+
671
+ </h3><div class="docstring">
672
+ <div class="discussion">
673
+
674
+ <p>Returns the value of attribute configuration</p>
675
+
676
+
677
+ </div>
678
+ </div>
679
+ <div class="tags">
680
+
681
+
682
+ </div><table class="source_code">
683
+ <tr>
684
+ <td>
685
+ <pre class="lines">
686
+
687
+
688
+ 22
689
+ 23
690
+ 24</pre>
691
+ </td>
692
+ <td>
693
+ <pre class="code"><span class="info file"># File 'lib/contentful/client.rb', line 22</span>
694
+
695
+ <span class='kw'>def</span> <span class='id identifier rubyid_configuration'>configuration</span>
696
+ <span class='ivar'>@configuration</span>
697
+ <span class='kw'>end</span></pre>
698
+ </td>
699
+ </tr>
700
+ </table>
701
+ </div>
702
+
703
+
704
+ <span id=""></span>
705
+ <div class="method_details ">
706
+ <h3 class="signature " id="dynamic_entry_cache-instance_method">
707
+
708
+ - (<tt>Object</tt>) <strong>dynamic_entry_cache</strong> <span class="extras">(readonly)</span>
709
+
710
+
711
+
712
+
713
+
714
+ </h3><div class="docstring">
715
+ <div class="discussion">
716
+
717
+ <p>Returns the value of attribute dynamic_entry_cache</p>
718
+
719
+
720
+ </div>
721
+ </div>
722
+ <div class="tags">
723
+
724
+
725
+ </div><table class="source_code">
726
+ <tr>
727
+ <td>
728
+ <pre class="lines">
729
+
730
+
731
+ 22
732
+ 23
733
+ 24</pre>
734
+ </td>
735
+ <td>
736
+ <pre class="code"><span class="info file"># File 'lib/contentful/client.rb', line 22</span>
737
+
738
+ <span class='kw'>def</span> <span class='id identifier rubyid_dynamic_entry_cache'>dynamic_entry_cache</span>
739
+ <span class='ivar'>@dynamic_entry_cache</span>
740
+ <span class='kw'>end</span></pre>
741
+ </td>
742
+ </tr>
743
+ </table>
744
+ </div>
745
+
746
+ </div>
747
+
748
+
749
+ <div id="class_method_details" class="method_details_list">
750
+ <h2>Class Method Details</h2>
751
+
752
+
753
+ <div class="method_details first">
754
+ <h3 class="signature first" id="get_http-class_method">
755
+
756
+ + (<tt>Object</tt>) <strong>get_http</strong>(url, query, headers = {})
757
+
758
+
759
+
760
+
761
+
762
+ </h3><div class="docstring">
763
+ <div class="discussion">
764
+
765
+ <p>Wraps the actual HTTP request</p>
766
+
767
+
768
+ </div>
769
+ </div>
770
+ <div class="tags">
771
+
772
+
773
+ </div><table class="source_code">
774
+ <tr>
775
+ <td>
776
+ <pre class="lines">
777
+
778
+
779
+ 26
780
+ 27
781
+ 28</pre>
782
+ </td>
783
+ <td>
784
+ <pre class="code"><span class="info file"># File 'lib/contentful/client.rb', line 26</span>
785
+
786
+ <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_get_http'>get_http</span><span class='lparen'>(</span><span class='id identifier rubyid_url'>url</span><span class='comma'>,</span> <span class='id identifier rubyid_query'>query</span><span class='comma'>,</span> <span class='id identifier rubyid_headers'>headers</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
787
+ <span class='const'>HTTP</span><span class='lbracket'>[</span><span class='id identifier rubyid_headers'>headers</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='id identifier rubyid_url'>url</span><span class='comma'>,</span> <span class='label'>params:</span> <span class='id identifier rubyid_query'>query</span><span class='rparen'>)</span>
788
+ <span class='kw'>end</span></pre>
789
+ </td>
790
+ </tr>
791
+ </table>
792
+ </div>
793
+
794
+ </div>
795
+
796
+ <div id="instance_method_details" class="method_details_list">
797
+ <h2>Instance Method Details</h2>
798
+
799
+
800
+ <div class="method_details first">
801
+ <h3 class="signature first" id="asset-instance_method">
802
+
803
+ - (<tt>Object</tt>) <strong>asset</strong>(id, query = {})
804
+
805
+
806
+
807
+
808
+
809
+ </h3><div class="docstring">
810
+ <div class="discussion">
811
+
812
+ <p>Gets a specific asset Takes an id and an optional hash of query options
813
+ Returns a Contentful::Asset</p>
814
+
815
+
816
+ </div>
817
+ </div>
818
+ <div class="tags">
819
+
820
+
821
+ </div><table class="source_code">
822
+ <tr>
823
+ <td>
824
+ <pre class="lines">
825
+
826
+
827
+ 85
828
+ 86
829
+ 87</pre>
830
+ </td>
831
+ <td>
832
+ <pre class="code"><span class="info file"># File 'lib/contentful/client.rb', line 85</span>
833
+
834
+ <span class='kw'>def</span> <span class='id identifier rubyid_asset'>asset</span><span class='lparen'>(</span><span class='id identifier rubyid_id'>id</span><span class='comma'>,</span> <span class='id identifier rubyid_query'>query</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
835
+ <span class='const'>Request</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='kw'>self</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>/assets</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='id identifier rubyid_query'>query</span><span class='comma'>,</span> <span class='id identifier rubyid_id'>id</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span>
836
+ <span class='kw'>end</span></pre>
837
+ </td>
838
+ </tr>
839
+ </table>
840
+ </div>
841
+
842
+ <div class="method_details ">
843
+ <h3 class="signature " id="assets-instance_method">
844
+
845
+ - (<tt>Object</tt>) <strong>assets</strong>(query = {})
846
+
847
+
848
+
849
+
850
+
851
+ </h3><div class="docstring">
852
+ <div class="discussion">
853
+
854
+ <p>Gets a collection of assets Takes an optional hash of query options Returns
855
+ a Contentful::Array of Contentful::Asset</p>
856
+
857
+
858
+ </div>
859
+ </div>
860
+ <div class="tags">
861
+
862
+
863
+ </div><table class="source_code">
864
+ <tr>
865
+ <td>
866
+ <pre class="lines">
867
+
868
+
869
+ 92
870
+ 93
871
+ 94</pre>
872
+ </td>
873
+ <td>
874
+ <pre class="code"><span class="info file"># File 'lib/contentful/client.rb', line 92</span>
875
+
876
+ <span class='kw'>def</span> <span class='id identifier rubyid_assets'>assets</span><span class='lparen'>(</span><span class='id identifier rubyid_query'>query</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
877
+ <span class='const'>Request</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='kw'>self</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>/assets</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='id identifier rubyid_query'>query</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span>
878
+ <span class='kw'>end</span></pre>
879
+ </td>
880
+ </tr>
881
+ </table>
882
+ </div>
883
+
884
+ <div class="method_details ">
885
+ <h3 class="signature " id="base_url-instance_method">
886
+
887
+ - (<tt>Object</tt>) <strong>base_url</strong>
888
+
889
+
890
+
891
+
892
+
893
+ </h3><div class="docstring">
894
+ <div class="discussion">
895
+
896
+ <p>Returns the base url for all of the client's requests</p>
897
+
898
+
899
+ </div>
900
+ </div>
901
+ <div class="tags">
902
+
903
+
904
+ </div><table class="source_code">
905
+ <tr>
906
+ <td>
907
+ <pre class="lines">
908
+
909
+
910
+ 97
911
+ 98
912
+ 99</pre>
913
+ </td>
914
+ <td>
915
+ <pre class="code"><span class="info file"># File 'lib/contentful/client.rb', line 97</span>
916
+
917
+ <span class='kw'>def</span> <span class='id identifier rubyid_base_url'>base_url</span>
918
+ <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>http</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_configuration'>configuration</span><span class='lbracket'>[</span><span class='symbol'>:secure</span><span class='rbracket'>]</span> <span class='op'>?</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>s</span><span class='tstring_end'>'</span></span> <span class='op'>:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_end'>'</span></span><span class='rbrace'>}</span><span class='tstring_content'>://</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_configuration'>configuration</span><span class='lbracket'>[</span><span class='symbol'>:api_url</span><span class='rbracket'>]</span><span class='rbrace'>}</span><span class='tstring_content'>/spaces/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_configuration'>configuration</span><span class='lbracket'>[</span><span class='symbol'>:space</span><span class='rbracket'>]</span><span class='rbrace'>}</span><span class='tstring_end'>&quot;</span></span>
919
+ <span class='kw'>end</span></pre>
920
+ </td>
921
+ </tr>
922
+ </table>
923
+ </div>
924
+
925
+ <div class="method_details ">
926
+ <h3 class="signature " id="content_type-instance_method">
927
+
928
+ - (<tt>Object</tt>) <strong>content_type</strong>(id, query = {})
929
+
930
+
931
+
932
+
933
+
934
+ </h3><div class="docstring">
935
+ <div class="discussion">
936
+
937
+ <p>Gets a specific content type Takes an id and an optional hash of query
938
+ options Returns a Contentful::ContentType</p>
939
+
940
+
941
+ </div>
942
+ </div>
943
+ <div class="tags">
944
+
945
+
946
+ </div><table class="source_code">
947
+ <tr>
948
+ <td>
949
+ <pre class="lines">
950
+
951
+
952
+ 57
953
+ 58
954
+ 59</pre>
955
+ </td>
956
+ <td>
957
+ <pre class="code"><span class="info file"># File 'lib/contentful/client.rb', line 57</span>
958
+
959
+ <span class='kw'>def</span> <span class='id identifier rubyid_content_type'>content_type</span><span class='lparen'>(</span><span class='id identifier rubyid_id'>id</span><span class='comma'>,</span> <span class='id identifier rubyid_query'>query</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
960
+ <span class='const'>Request</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='kw'>self</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>/content_types</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='id identifier rubyid_query'>query</span><span class='comma'>,</span> <span class='id identifier rubyid_id'>id</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span>
961
+ <span class='kw'>end</span></pre>
962
+ </td>
963
+ </tr>
964
+ </table>
965
+ </div>
966
+
967
+ <div class="method_details ">
968
+ <h3 class="signature " id="content_types-instance_method">
969
+
970
+ - (<tt>Object</tt>) <strong>content_types</strong>(query = {})
971
+
972
+
973
+
974
+
975
+
976
+ </h3><div class="docstring">
977
+ <div class="discussion">
978
+
979
+ <p>Gets a collection of content types Takes an optional hash of query options
980
+ Returns a Contentful::Array of Contentful::ContentType</p>
981
+
982
+
983
+ </div>
984
+ </div>
985
+ <div class="tags">
986
+
987
+
988
+ </div><table class="source_code">
989
+ <tr>
990
+ <td>
991
+ <pre class="lines">
992
+
993
+
994
+ 64
995
+ 65
996
+ 66</pre>
997
+ </td>
998
+ <td>
999
+ <pre class="code"><span class="info file"># File 'lib/contentful/client.rb', line 64</span>
1000
+
1001
+ <span class='kw'>def</span> <span class='id identifier rubyid_content_types'>content_types</span><span class='lparen'>(</span><span class='id identifier rubyid_query'>query</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
1002
+ <span class='const'>Request</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='kw'>self</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>/content_types</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='id identifier rubyid_query'>query</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span>
1003
+ <span class='kw'>end</span></pre>
1004
+ </td>
1005
+ </tr>
1006
+ </table>
1007
+ </div>
1008
+
1009
+ <div class="method_details ">
1010
+ <h3 class="signature " id="default_configuration-instance_method">
1011
+
1012
+ - (<tt>Object</tt>) <strong>default_configuration</strong>
1013
+
1014
+
1015
+
1016
+
1017
+
1018
+ </h3><div class="docstring">
1019
+ <div class="discussion">
1020
+
1021
+ <p>Returns the default configuration</p>
1022
+
1023
+
1024
+ </div>
1025
+ </div>
1026
+ <div class="tags">
1027
+
1028
+
1029
+ </div><table class="source_code">
1030
+ <tr>
1031
+ <td>
1032
+ <pre class="lines">
1033
+
1034
+
1035
+ 43
1036
+ 44
1037
+ 45</pre>
1038
+ </td>
1039
+ <td>
1040
+ <pre class="code"><span class="info file"># File 'lib/contentful/client.rb', line 43</span>
1041
+
1042
+ <span class='kw'>def</span> <span class='id identifier rubyid_default_configuration'>default_configuration</span>
1043
+ <span class='const'>DEFAULT_CONFIGURATION</span>
1044
+ <span class='kw'>end</span></pre>
1045
+ </td>
1046
+ </tr>
1047
+ </table>
1048
+ </div>
1049
+
1050
+ <div class="method_details ">
1051
+ <h3 class="signature " id="entries-instance_method">
1052
+
1053
+ - (<tt>Object</tt>) <strong>entries</strong>(query = {})
1054
+
1055
+
1056
+
1057
+
1058
+
1059
+ </h3><div class="docstring">
1060
+ <div class="discussion">
1061
+
1062
+ <p>Gets a collection of entries Takes an optional hash of query options
1063
+ Returns a Contentful::Array of Contentful::Entry</p>
1064
+
1065
+
1066
+ </div>
1067
+ </div>
1068
+ <div class="tags">
1069
+
1070
+
1071
+ </div><table class="source_code">
1072
+ <tr>
1073
+ <td>
1074
+ <pre class="lines">
1075
+
1076
+
1077
+ 78
1078
+ 79
1079
+ 80</pre>
1080
+ </td>
1081
+ <td>
1082
+ <pre class="code"><span class="info file"># File 'lib/contentful/client.rb', line 78</span>
1083
+
1084
+ <span class='kw'>def</span> <span class='id identifier rubyid_entries'>entries</span><span class='lparen'>(</span><span class='id identifier rubyid_query'>query</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
1085
+ <span class='const'>Request</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='kw'>self</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>/entries</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='id identifier rubyid_query'>query</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span>
1086
+ <span class='kw'>end</span></pre>
1087
+ </td>
1088
+ </tr>
1089
+ </table>
1090
+ </div>
1091
+
1092
+ <div class="method_details ">
1093
+ <h3 class="signature " id="entry-instance_method">
1094
+
1095
+ - (<tt>Object</tt>) <strong>entry</strong>(id, query = {})
1096
+
1097
+
1098
+
1099
+
1100
+
1101
+ </h3><div class="docstring">
1102
+ <div class="discussion">
1103
+
1104
+ <p>Gets a specific entry Takes an id and an optional hash of query options
1105
+ Returns a Contentful::Entry</p>
1106
+
1107
+
1108
+ </div>
1109
+ </div>
1110
+ <div class="tags">
1111
+
1112
+
1113
+ </div><table class="source_code">
1114
+ <tr>
1115
+ <td>
1116
+ <pre class="lines">
1117
+
1118
+
1119
+ 71
1120
+ 72
1121
+ 73</pre>
1122
+ </td>
1123
+ <td>
1124
+ <pre class="code"><span class="info file"># File 'lib/contentful/client.rb', line 71</span>
1125
+
1126
+ <span class='kw'>def</span> <span class='id identifier rubyid_entry'>entry</span><span class='lparen'>(</span><span class='id identifier rubyid_id'>id</span><span class='comma'>,</span> <span class='id identifier rubyid_query'>query</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
1127
+ <span class='const'>Request</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='kw'>self</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>/entries</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='id identifier rubyid_query'>query</span><span class='comma'>,</span> <span class='id identifier rubyid_id'>id</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span>
1128
+ <span class='kw'>end</span></pre>
1129
+ </td>
1130
+ </tr>
1131
+ </table>
1132
+ </div>
1133
+
1134
+ <div class="method_details ">
1135
+ <h3 class="signature " id="get-instance_method">
1136
+
1137
+ - (<tt>Object</tt>) <strong>get</strong>(request, build_resource = true)
1138
+
1139
+
1140
+
1141
+
1142
+
1143
+ </h3><div class="docstring">
1144
+ <div class="discussion">
1145
+
1146
+ <p>Get a Contentful::Request object Set second parameter to false to
1147
+ deactivate Resource building and return Response objects instead</p>
1148
+
1149
+
1150
+ </div>
1151
+ </div>
1152
+ <div class="tags">
1153
+
1154
+
1155
+ </div><table class="source_code">
1156
+ <tr>
1157
+ <td>
1158
+ <pre class="lines">
1159
+
1160
+
1161
+ 122
1162
+ 123
1163
+ 124
1164
+ 125
1165
+ 126
1166
+ 127
1167
+ 128
1168
+ 129
1169
+ 130
1170
+ 131
1171
+ 132
1172
+ 133
1173
+ 134
1174
+ 135
1175
+ 136</pre>
1176
+ </td>
1177
+ <td>
1178
+ <pre class="code"><span class="info file"># File 'lib/contentful/client.rb', line 122</span>
1179
+
1180
+ <span class='kw'>def</span> <span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='id identifier rubyid_request'>request</span><span class='comma'>,</span> <span class='id identifier rubyid_build_resource'>build_resource</span> <span class='op'>=</span> <span class='kw'>true</span><span class='rparen'>)</span>
1181
+ <span class='id identifier rubyid_response'>response</span> <span class='op'>=</span> <span class='const'>Response</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span>
1182
+ <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span><span class='period'>.</span><span class='id identifier rubyid_get_http'>get_http</span><span class='lparen'>(</span>
1183
+ <span class='id identifier rubyid_base_url'>base_url</span> <span class='op'>+</span> <span class='id identifier rubyid_request'>request</span><span class='period'>.</span><span class='id identifier rubyid_url'>url</span><span class='comma'>,</span>
1184
+ <span class='id identifier rubyid_request_query'>request_query</span><span class='lparen'>(</span><span class='id identifier rubyid_request'>request</span><span class='period'>.</span><span class='id identifier rubyid_query'>query</span><span class='rparen'>)</span><span class='comma'>,</span>
1185
+ <span class='id identifier rubyid_request_headers'>request_headers</span><span class='comma'>,</span>
1186
+ <span class='rparen'>)</span>
1187
+ <span class='rparen'>)</span>
1188
+
1189
+ <span class='kw'>return</span> <span class='id identifier rubyid_response'>response</span> <span class='kw'>if</span> <span class='op'>!</span><span class='id identifier rubyid_build_resource'>build_resource</span> <span class='op'>||</span> <span class='id identifier rubyid_configuration'>configuration</span><span class='lbracket'>[</span><span class='symbol'>:raw_mode</span><span class='rbracket'>]</span>
1190
+
1191
+ <span class='id identifier rubyid_result'>result</span> <span class='op'>=</span> <span class='id identifier rubyid_configuration'>configuration</span><span class='lbracket'>[</span><span class='symbol'>:resource_builder</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='kw'>self</span><span class='comma'>,</span> <span class='id identifier rubyid_response'>response</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_run'>run</span>
1192
+ <span class='id identifier rubyid_raise'>raise</span> <span class='id identifier rubyid_result'>result</span> <span class='kw'>if</span> <span class='id identifier rubyid_result'>result</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>Error</span><span class='rparen'>)</span> <span class='op'>&amp;&amp;</span> <span class='id identifier rubyid_configuration'>configuration</span><span class='lbracket'>[</span><span class='symbol'>:raise_errors</span><span class='rbracket'>]</span>
1193
+ <span class='id identifier rubyid_result'>result</span>
1194
+ <span class='kw'>end</span></pre>
1195
+ </td>
1196
+ </tr>
1197
+ </table>
1198
+ </div>
1199
+
1200
+ <div class="method_details ">
1201
+ <h3 class="signature " id="request_headers-instance_method">
1202
+
1203
+ - (<tt>Object</tt>) <strong>request_headers</strong>
1204
+
1205
+
1206
+
1207
+
1208
+
1209
+ </h3><div class="docstring">
1210
+ <div class="discussion">
1211
+
1212
+ <p>Returns the headers used for the HTTP requests</p>
1213
+
1214
+
1215
+ </div>
1216
+ </div>
1217
+ <div class="tags">
1218
+
1219
+
1220
+ </div><table class="source_code">
1221
+ <tr>
1222
+ <td>
1223
+ <pre class="lines">
1224
+
1225
+
1226
+ 102
1227
+ 103
1228
+ 104
1229
+ 105
1230
+ 106
1231
+ 107
1232
+ 108</pre>
1233
+ </td>
1234
+ <td>
1235
+ <pre class="code"><span class="info file"># File 'lib/contentful/client.rb', line 102</span>
1236
+
1237
+ <span class='kw'>def</span> <span class='id identifier rubyid_request_headers'>request_headers</span>
1238
+ <span class='id identifier rubyid_headers'>headers</span> <span class='op'>=</span> <span class='lbrace'>{</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>User-Agent</span><span class='tstring_end'>&quot;</span></span> <span class='op'>=&gt;</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>RubyContentfulGem/</span><span class='embexpr_beg'>#{</span><span class='const'>Contentful</span><span class='op'>::</span><span class='const'>VERSION</span><span class='rbrace'>}</span><span class='tstring_end'>&quot;</span></span> <span class='rbrace'>}</span>
1239
+ <span class='id identifier rubyid_headers'>headers</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Authorization</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Bearer </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_configuration'>configuration</span><span class='lbracket'>[</span><span class='symbol'>:access_token</span><span class='rbracket'>]</span><span class='rbrace'>}</span><span class='tstring_end'>&quot;</span></span> <span class='kw'>if</span> <span class='id identifier rubyid_configuration'>configuration</span><span class='lbracket'>[</span><span class='symbol'>:authentication_mechanism</span><span class='rbracket'>]</span> <span class='op'>==</span> <span class='symbol'>:header</span>
1240
+ <span class='id identifier rubyid_headers'>headers</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Content-Type</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>application/vnd.contentful.delivery.v</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_configuration'>configuration</span><span class='lbracket'>[</span><span class='symbol'>:api_version</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_to_i'>to_i</span><span class='rbrace'>}</span><span class='tstring_content'>+json</span><span class='tstring_end'>&quot;</span></span> <span class='kw'>if</span> <span class='id identifier rubyid_configuration'>configuration</span><span class='lbracket'>[</span><span class='symbol'>:api_version</span><span class='rbracket'>]</span>
1241
+
1242
+ <span class='id identifier rubyid_headers'>headers</span>
1243
+ <span class='kw'>end</span></pre>
1244
+ </td>
1245
+ </tr>
1246
+ </table>
1247
+ </div>
1248
+
1249
+ <div class="method_details ">
1250
+ <h3 class="signature " id="request_query-instance_method">
1251
+
1252
+ - (<tt>Object</tt>) <strong>request_query</strong>(query)
1253
+
1254
+
1255
+
1256
+
1257
+
1258
+ </h3><div class="docstring">
1259
+ <div class="discussion">
1260
+
1261
+ <p>Patches a query hash with the client configurations for queries</p>
1262
+
1263
+
1264
+ </div>
1265
+ </div>
1266
+ <div class="tags">
1267
+
1268
+
1269
+ </div><table class="source_code">
1270
+ <tr>
1271
+ <td>
1272
+ <pre class="lines">
1273
+
1274
+
1275
+ 111
1276
+ 112
1277
+ 113
1278
+ 114
1279
+ 115
1280
+ 116
1281
+ 117</pre>
1282
+ </td>
1283
+ <td>
1284
+ <pre class="code"><span class="info file"># File 'lib/contentful/client.rb', line 111</span>
1285
+
1286
+ <span class='kw'>def</span> <span class='id identifier rubyid_request_query'>request_query</span><span class='lparen'>(</span><span class='id identifier rubyid_query'>query</span><span class='rparen'>)</span>
1287
+ <span class='kw'>if</span> <span class='id identifier rubyid_configuration'>configuration</span><span class='lbracket'>[</span><span class='symbol'>:authentication_mechanism</span><span class='rbracket'>]</span> <span class='op'>==</span> <span class='symbol'>:query_string</span>
1288
+ <span class='id identifier rubyid_query'>query</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>access_token</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_configuration'>configuration</span><span class='lbracket'>[</span><span class='symbol'>:access_token</span><span class='rbracket'>]</span>
1289
+ <span class='kw'>end</span>
1290
+
1291
+ <span class='id identifier rubyid_query'>query</span>
1292
+ <span class='kw'>end</span></pre>
1293
+ </td>
1294
+ </tr>
1295
+ </table>
1296
+ </div>
1297
+
1298
+ <div class="method_details ">
1299
+ <h3 class="signature " id="space-instance_method">
1300
+
1301
+ - (<tt>Object</tt>) <strong>space</strong>(query = {})
1302
+
1303
+
1304
+
1305
+
1306
+
1307
+ </h3><div class="docstring">
1308
+ <div class="discussion">
1309
+
1310
+ <p>Gets the client's space Takes an optional hash of query options Returns a
1311
+ Contentful::Space</p>
1312
+
1313
+
1314
+ </div>
1315
+ </div>
1316
+ <div class="tags">
1317
+
1318
+
1319
+ </div><table class="source_code">
1320
+ <tr>
1321
+ <td>
1322
+ <pre class="lines">
1323
+
1324
+
1325
+ 50
1326
+ 51
1327
+ 52</pre>
1328
+ </td>
1329
+ <td>
1330
+ <pre class="code"><span class="info file"># File 'lib/contentful/client.rb', line 50</span>
1331
+
1332
+ <span class='kw'>def</span> <span class='id identifier rubyid_space'>space</span><span class='lparen'>(</span><span class='id identifier rubyid_query'>query</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
1333
+ <span class='const'>Request</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='kw'>self</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='id identifier rubyid_query'>query</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span>
1334
+ <span class='kw'>end</span></pre>
1335
+ </td>
1336
+ </tr>
1337
+ </table>
1338
+ </div>
1339
+
1340
+ <div class="method_details ">
1341
+ <h3 class="signature " id="update_dynamic_entry_cache!-instance_method">
1342
+
1343
+ - (<tt>Object</tt>) <strong>update_dynamic_entry_cache!</strong>
1344
+
1345
+
1346
+
1347
+
1348
+
1349
+ </h3><div class="docstring">
1350
+ <div class="discussion">
1351
+
1352
+ <p>Use this method together with the client's :dynamic_entries configuration.
1353
+ See README for details.</p>
1354
+
1355
+
1356
+ </div>
1357
+ </div>
1358
+ <div class="tags">
1359
+
1360
+
1361
+ </div><table class="source_code">
1362
+ <tr>
1363
+ <td>
1364
+ <pre class="lines">
1365
+
1366
+
1367
+ 140
1368
+ 141
1369
+ 142
1370
+ 143
1371
+ 144
1372
+ 145
1373
+ 146
1374
+ 147
1375
+ 148
1376
+ 149</pre>
1377
+ </td>
1378
+ <td>
1379
+ <pre class="code"><span class="info file"># File 'lib/contentful/client.rb', line 140</span>
1380
+
1381
+ <span class='kw'>def</span> <span class='id identifier rubyid_update_dynamic_entry_cache!'>update_dynamic_entry_cache!</span>
1382
+ <span class='ivar'>@dynamic_entry_cache</span> <span class='op'>=</span> <span class='const'>Hash</span><span class='lbracket'>[</span>
1383
+ <span class='id identifier rubyid_content_types'>content_types</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_ct'>ct</span><span class='op'>|</span>
1384
+ <span class='lbracket'>[</span>
1385
+ <span class='id identifier rubyid_ct'>ct</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span><span class='period'>.</span><span class='id identifier rubyid_to_sym'>to_sym</span><span class='comma'>,</span>
1386
+ <span class='const'>DynamicEntry</span><span class='period'>.</span><span class='id identifier rubyid_create'>create</span><span class='lparen'>(</span><span class='id identifier rubyid_ct'>ct</span><span class='rparen'>)</span><span class='comma'>,</span>
1387
+ <span class='rbracket'>]</span>
1388
+ <span class='rbrace'>}</span>
1389
+ <span class='rbracket'>]</span>
1390
+ <span class='kw'>end</span></pre>
1391
+ </td>
1392
+ </tr>
1393
+ </table>
1394
+ </div>
1395
+
1396
+ </div>
1397
+
1398
+ </div>
1399
+
1400
+ <div id="footer">
1401
+ Generated on Tue Mar 11 09:25:53 2014 by
1402
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
1403
+ 0.8.7.3 (ruby-1.9.3).
1404
+ </div>
1405
+
1406
+ </body>
1407
+ </html>