contentful 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
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,1407 +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::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>