contentful 2.1.1 → 2.1.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (115) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +6 -0
  3. data/Gemfile.lock +37 -46
  4. data/lib/contentful/array.rb +8 -1
  5. data/lib/contentful/entry.rb +9 -9
  6. data/lib/contentful/fields_resource.rb +9 -8
  7. data/lib/contentful/resource_builder.rb +1 -7
  8. data/lib/contentful/support.rb +22 -0
  9. data/lib/contentful/version.rb +1 -1
  10. data/spec/array_spec.rb +21 -0
  11. data/spec/fixtures/vcr_cassettes/array/nested_resources.yml +159 -0
  12. metadata +5 -106
  13. data/coverage/.last_run.json +0 -5
  14. data/coverage/.resultset.json +0 -1887
  15. data/coverage/.resultset.json.lock +0 -0
  16. data/coverage/assets/0.10.0/application.css +0 -799
  17. data/coverage/assets/0.10.0/application.js +0 -1707
  18. data/coverage/assets/0.10.0/colorbox/border.png +0 -0
  19. data/coverage/assets/0.10.0/colorbox/controls.png +0 -0
  20. data/coverage/assets/0.10.0/colorbox/loading.gif +0 -0
  21. data/coverage/assets/0.10.0/colorbox/loading_background.png +0 -0
  22. data/coverage/assets/0.10.0/favicon_green.png +0 -0
  23. data/coverage/assets/0.10.0/favicon_red.png +0 -0
  24. data/coverage/assets/0.10.0/favicon_yellow.png +0 -0
  25. data/coverage/assets/0.10.0/loading.gif +0 -0
  26. data/coverage/assets/0.10.0/magnify.png +0 -0
  27. data/coverage/assets/0.10.0/smoothness/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
  28. data/coverage/assets/0.10.0/smoothness/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
  29. data/coverage/assets/0.10.0/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
  30. data/coverage/assets/0.10.0/smoothness/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
  31. data/coverage/assets/0.10.0/smoothness/images/ui-bg_glass_75_dadada_1x400.png +0 -0
  32. data/coverage/assets/0.10.0/smoothness/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
  33. data/coverage/assets/0.10.0/smoothness/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
  34. data/coverage/assets/0.10.0/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
  35. data/coverage/assets/0.10.0/smoothness/images/ui-icons_222222_256x240.png +0 -0
  36. data/coverage/assets/0.10.0/smoothness/images/ui-icons_2e83ff_256x240.png +0 -0
  37. data/coverage/assets/0.10.0/smoothness/images/ui-icons_454545_256x240.png +0 -0
  38. data/coverage/assets/0.10.0/smoothness/images/ui-icons_888888_256x240.png +0 -0
  39. data/coverage/assets/0.10.0/smoothness/images/ui-icons_cd0a0a_256x240.png +0 -0
  40. data/coverage/index.html +0 -11816
  41. data/doc/Contentful.html +0 -153
  42. data/doc/Contentful/AccessDenied.html +0 -161
  43. data/doc/Contentful/Array.html +0 -743
  44. data/doc/Contentful/ArrayCoercion.html +0 -244
  45. data/doc/Contentful/ArrayLike.html +0 -627
  46. data/doc/Contentful/Asset.html +0 -475
  47. data/doc/Contentful/BadRequest.html +0 -161
  48. data/doc/Contentful/BaseCoercion.html +0 -447
  49. data/doc/Contentful/BaseResource.html +0 -599
  50. data/doc/Contentful/BooleanCoercion.html +0 -244
  51. data/doc/Contentful/Client.html +0 -1606
  52. data/doc/Contentful/Constants.html +0 -636
  53. data/doc/Contentful/ContentType.html +0 -614
  54. data/doc/Contentful/ContentTypeCache.html +0 -430
  55. data/doc/Contentful/DateCoercion.html +0 -240
  56. data/doc/Contentful/DeletedAsset.html +0 -159
  57. data/doc/Contentful/DeletedEntry.html +0 -159
  58. data/doc/Contentful/DynamicEntry.html +0 -214
  59. data/doc/Contentful/Entry.html +0 -273
  60. data/doc/Contentful/Error.html +0 -424
  61. data/doc/Contentful/Field.html +0 -929
  62. data/doc/Contentful/FieldsResource.html +0 -501
  63. data/doc/Contentful/File.html +0 -520
  64. data/doc/Contentful/FloatCoercion.html +0 -240
  65. data/doc/Contentful/IntegerCoercion.html +0 -240
  66. data/doc/Contentful/Link.html +0 -251
  67. data/doc/Contentful/LinkCoercion.html +0 -160
  68. data/doc/Contentful/Locale.html +0 -447
  69. data/doc/Contentful/Location.html +0 -385
  70. data/doc/Contentful/LocationCoercion.html +0 -240
  71. data/doc/Contentful/NotFound.html +0 -161
  72. data/doc/Contentful/ObjectCoercion.html +0 -240
  73. data/doc/Contentful/RateLimitExceeded.html +0 -161
  74. data/doc/Contentful/Request.html +0 -889
  75. data/doc/Contentful/Resource.html +0 -117
  76. data/doc/Contentful/Resource/ArrayLike.html +0 -627
  77. data/doc/Contentful/Resource/AssetFields.html +0 -246
  78. data/doc/Contentful/Resource/AssetFields/ClassMethods.html +0 -174
  79. data/doc/Contentful/Resource/ClassMethods.html +0 -378
  80. data/doc/Contentful/Resource/CustomResource.html +0 -119
  81. data/doc/Contentful/Resource/Fields.html +0 -288
  82. data/doc/Contentful/Resource/Fields/ClassMethods.html +0 -187
  83. data/doc/Contentful/Resource/LocalizedFields.html +0 -305
  84. data/doc/Contentful/Resource/SystemProperties.html +0 -205
  85. data/doc/Contentful/Resource/SystemProperties/ClassMethods.html +0 -174
  86. data/doc/Contentful/ResourceBuilder.html +0 -969
  87. data/doc/Contentful/Response.html +0 -641
  88. data/doc/Contentful/ServerError.html +0 -161
  89. data/doc/Contentful/ServiceUnavailable.html +0 -161
  90. data/doc/Contentful/Space.html +0 -395
  91. data/doc/Contentful/StringCoercion.html +0 -244
  92. data/doc/Contentful/Support.html +0 -550
  93. data/doc/Contentful/SymbolCoercion.html +0 -171
  94. data/doc/Contentful/Sync.html +0 -655
  95. data/doc/Contentful/SyncPage.html +0 -801
  96. data/doc/Contentful/TextCoercion.html +0 -171
  97. data/doc/Contentful/Unauthorized.html +0 -161
  98. data/doc/Contentful/UnparsableJson.html +0 -161
  99. data/doc/Contentful/UnparsableResource.html +0 -137
  100. data/doc/_index.html +0 -537
  101. data/doc/class_list.html +0 -51
  102. data/doc/css/common.css +0 -1
  103. data/doc/css/full_list.css +0 -58
  104. data/doc/css/style.css +0 -481
  105. data/doc/file.CHANGELOG.html +0 -506
  106. data/doc/file.LICENSE.html +0 -72
  107. data/doc/file.README.html +0 -565
  108. data/doc/file_list.html +0 -66
  109. data/doc/frames.html +0 -17
  110. data/doc/index.html +0 -565
  111. data/doc/js/app.js +0 -243
  112. data/doc/js/full_list.js +0 -216
  113. data/doc/js/jquery.js +0 -4
  114. data/doc/method_list.html +0 -1115
  115. data/doc/top-level-namespace.html +0 -112
@@ -1,929 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <meta charset="utf-8">
5
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
- <title>
7
- Class: Contentful::Field
8
-
9
- &mdash; Documentation by YARD 0.9.5
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
- pathId = "Contentful::Field";
19
- relpath = '../';
20
- </script>
21
-
22
-
23
- <script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
24
-
25
- <script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
26
-
27
-
28
- </head>
29
- <body>
30
- <div class="nav_wrap">
31
- <iframe id="nav" src="../class_list.html"></iframe>
32
- <div id="resizer"></div>
33
- </div>
34
-
35
- <div id="main" tabindex="-1">
36
- <div id="header">
37
- <div id="menu">
38
-
39
- <a href="../_index.html">Index (F)</a> &raquo;
40
- <span class='title'><span class='object_link'><a href="../Contentful.html" title="Contentful (module)">Contentful</a></span></span>
41
- &raquo;
42
- <span class="title">Field</span>
43
-
44
- </div>
45
-
46
- <div id="search">
47
-
48
- <a class="full_list_link" id="class_list_link"
49
- href="../class_list.html">
50
-
51
- <svg width="24" height="24">
52
- <rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
53
- <rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
54
- <rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
55
- </svg>
56
- </a>
57
-
58
- </div>
59
- <div class="clear"></div>
60
- </div>
61
-
62
- <iframe id="search_frame" src="../class_list.html"></iframe>
63
-
64
- <div id="content"><h1>Class: Contentful::Field
65
-
66
-
67
-
68
- </h1>
69
- <div class="box_info">
70
-
71
- <dl>
72
- <dt>Inherits:</dt>
73
- <dd>
74
- <span class="inheritName">Object</span>
75
-
76
- <ul class="fullTree">
77
- <li>Object</li>
78
-
79
- <li class="next">Contentful::Field</li>
80
-
81
- </ul>
82
- <a href="#" class="inheritanceTree">show all</a>
83
-
84
- </dd>
85
- </dl>
86
-
87
-
88
-
89
-
90
-
91
-
92
-
93
-
94
-
95
-
96
-
97
- <dl>
98
- <dt>Defined in:</dt>
99
- <dd>lib/contentful/field.rb</dd>
100
- </dl>
101
-
102
- </div>
103
-
104
- <h2>Overview</h2><div class="docstring">
105
- <div class="discussion">
106
-
107
- <p>A ContentType&#39;s field schema See <a
108
- href="https://www.contentful.com/developers/documentation/content-management-api/#resources-content-types-fields">www.contentful.com/developers/documentation/content-management-api/#resources-content-types-fields</a></p>
109
-
110
-
111
- </div>
112
- </div>
113
- <div class="tags">
114
-
115
-
116
- </div>
117
- <h2>Constant Summary</h2>
118
- <dl class="constants">
119
-
120
- <dt id="KNOWN_TYPES-constant" class="">KNOWN_TYPES =
121
- <div class="docstring">
122
- <div class="discussion">
123
-
124
- <p>Coercions from Contentful Types to Ruby native types</p>
125
-
126
-
127
- </div>
128
- </div>
129
- <div class="tags">
130
-
131
-
132
- </div>
133
- </dt>
134
- <dd><pre class="code"><span class='lbrace'>{</span>
135
- <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>String</span><span class='tstring_end'>&#39;</span></span> <span class='op'>=&gt;</span> <span class='const'>StringCoercion</span><span class='comma'>,</span>
136
- <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Text</span><span class='tstring_end'>&#39;</span></span> <span class='op'>=&gt;</span> <span class='const'>TextCoercion</span><span class='comma'>,</span>
137
- <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Symbol</span><span class='tstring_end'>&#39;</span></span> <span class='op'>=&gt;</span> <span class='const'>SymbolCoercion</span><span class='comma'>,</span>
138
- <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Integer</span><span class='tstring_end'>&#39;</span></span> <span class='op'>=&gt;</span> <span class='const'>IntegerCoercion</span><span class='comma'>,</span>
139
- <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Number</span><span class='tstring_end'>&#39;</span></span> <span class='op'>=&gt;</span> <span class='const'>FloatCoercion</span><span class='comma'>,</span>
140
- <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Boolean</span><span class='tstring_end'>&#39;</span></span> <span class='op'>=&gt;</span> <span class='const'>BooleanCoercion</span><span class='comma'>,</span>
141
- <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Date</span><span class='tstring_end'>&#39;</span></span> <span class='op'>=&gt;</span> <span class='const'>DateCoercion</span><span class='comma'>,</span>
142
- <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Location</span><span class='tstring_end'>&#39;</span></span> <span class='op'>=&gt;</span> <span class='const'>LocationCoercion</span><span class='comma'>,</span>
143
- <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Object</span><span class='tstring_end'>&#39;</span></span> <span class='op'>=&gt;</span> <span class='const'>ObjectCoercion</span><span class='comma'>,</span>
144
- <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Array</span><span class='tstring_end'>&#39;</span></span> <span class='op'>=&gt;</span> <span class='const'>ArrayCoercion</span><span class='comma'>,</span>
145
- <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Link</span><span class='tstring_end'>&#39;</span></span> <span class='op'>=&gt;</span> <span class='const'>LinkCoercion</span>
146
- <span class='rbrace'>}</span></pre></dd>
147
-
148
- </dl>
149
-
150
-
151
-
152
-
153
- <h2>Instance Attribute Summary <small><a href="#" class="summary_toggle">collapse</a></small></h2>
154
- <ul class="summary">
155
-
156
- <li class="public ">
157
- <span class="summary_signature">
158
-
159
- <a href="#id-instance_method" title="#id (instance method)">#<strong>id</strong> &#x21d2; Object </a>
160
-
161
-
162
-
163
- </span>
164
-
165
-
166
-
167
-
168
- <span class="note title readonly">readonly</span>
169
-
170
-
171
-
172
-
173
-
174
-
175
-
176
-
177
-
178
- <span class="summary_desc"><div class='inline'>
179
- <p>Returns the value of attribute id.</p>
180
- </div></span>
181
-
182
- </li>
183
-
184
-
185
- <li class="public ">
186
- <span class="summary_signature">
187
-
188
- <a href="#items-instance_method" title="#items (instance method)">#<strong>items</strong> &#x21d2; Object </a>
189
-
190
-
191
-
192
- </span>
193
-
194
-
195
-
196
-
197
- <span class="note title readonly">readonly</span>
198
-
199
-
200
-
201
-
202
-
203
-
204
-
205
-
206
-
207
- <span class="summary_desc"><div class='inline'>
208
- <p>Returns the value of attribute items.</p>
209
- </div></span>
210
-
211
- </li>
212
-
213
-
214
- <li class="public ">
215
- <span class="summary_signature">
216
-
217
- <a href="#link_type-instance_method" title="#link_type (instance method)">#<strong>link_type</strong> &#x21d2; Object </a>
218
-
219
-
220
-
221
- </span>
222
-
223
-
224
-
225
-
226
- <span class="note title readonly">readonly</span>
227
-
228
-
229
-
230
-
231
-
232
-
233
-
234
-
235
-
236
- <span class="summary_desc"><div class='inline'>
237
- <p>Returns the value of attribute link_type.</p>
238
- </div></span>
239
-
240
- </li>
241
-
242
-
243
- <li class="public ">
244
- <span class="summary_signature">
245
-
246
- <a href="#localized-instance_method" title="#localized (instance method)">#<strong>localized</strong> &#x21d2; Object </a>
247
-
248
-
249
-
250
- </span>
251
-
252
-
253
-
254
-
255
- <span class="note title readonly">readonly</span>
256
-
257
-
258
-
259
-
260
-
261
-
262
-
263
-
264
-
265
- <span class="summary_desc"><div class='inline'>
266
- <p>Returns the value of attribute localized.</p>
267
- </div></span>
268
-
269
- </li>
270
-
271
-
272
- <li class="public ">
273
- <span class="summary_signature">
274
-
275
- <a href="#name-instance_method" title="#name (instance method)">#<strong>name</strong> &#x21d2; Object </a>
276
-
277
-
278
-
279
- </span>
280
-
281
-
282
-
283
-
284
- <span class="note title readonly">readonly</span>
285
-
286
-
287
-
288
-
289
-
290
-
291
-
292
-
293
-
294
- <span class="summary_desc"><div class='inline'>
295
- <p>Returns the value of attribute name.</p>
296
- </div></span>
297
-
298
- </li>
299
-
300
-
301
- <li class="public ">
302
- <span class="summary_signature">
303
-
304
- <a href="#raw-instance_method" title="#raw (instance method)">#<strong>raw</strong> &#x21d2; Object </a>
305
-
306
-
307
-
308
- </span>
309
-
310
-
311
-
312
-
313
- <span class="note title readonly">readonly</span>
314
-
315
-
316
-
317
-
318
-
319
-
320
-
321
-
322
-
323
- <span class="summary_desc"><div class='inline'>
324
- <p>Returns the value of attribute raw.</p>
325
- </div></span>
326
-
327
- </li>
328
-
329
-
330
- <li class="public ">
331
- <span class="summary_signature">
332
-
333
- <a href="#required-instance_method" title="#required (instance method)">#<strong>required</strong> &#x21d2; Object </a>
334
-
335
-
336
-
337
- </span>
338
-
339
-
340
-
341
-
342
- <span class="note title readonly">readonly</span>
343
-
344
-
345
-
346
-
347
-
348
-
349
-
350
-
351
-
352
- <span class="summary_desc"><div class='inline'>
353
- <p>Returns the value of attribute required.</p>
354
- </div></span>
355
-
356
- </li>
357
-
358
-
359
- <li class="public ">
360
- <span class="summary_signature">
361
-
362
- <a href="#type-instance_method" title="#type (instance method)">#<strong>type</strong> &#x21d2; Object </a>
363
-
364
-
365
-
366
- </span>
367
-
368
-
369
-
370
-
371
- <span class="note title readonly">readonly</span>
372
-
373
-
374
-
375
-
376
-
377
-
378
-
379
-
380
-
381
- <span class="summary_desc"><div class='inline'>
382
- <p>Returns the value of attribute type.</p>
383
- </div></span>
384
-
385
- </li>
386
-
387
-
388
- </ul>
389
-
390
-
391
-
392
-
393
-
394
- <h2>
395
- Instance Method Summary
396
- <small><a href="#" class="summary_toggle">collapse</a></small>
397
- </h2>
398
-
399
- <ul class="summary">
400
-
401
- <li class="public ">
402
- <span class="summary_signature">
403
-
404
- <a href="#coerce-instance_method" title="#coerce (instance method)">#<strong>coerce</strong>(value) &#x21d2; Object </a>
405
-
406
-
407
-
408
- </span>
409
-
410
-
411
-
412
-
413
-
414
-
415
-
416
-
417
-
418
- <span class="summary_desc"><div class='inline'>
419
- <p>Coerces value to proper type.</p>
420
- </div></span>
421
-
422
- </li>
423
-
424
-
425
- <li class="public ">
426
- <span class="summary_signature">
427
-
428
- <a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong>(json) &#x21d2; Field </a>
429
-
430
-
431
-
432
- </span>
433
-
434
-
435
- <span class="note title constructor">constructor</span>
436
-
437
-
438
-
439
-
440
-
441
-
442
-
443
-
444
- <span class="summary_desc"><div class='inline'>
445
- <p>A new instance of Field.</p>
446
- </div></span>
447
-
448
- </li>
449
-
450
-
451
- </ul>
452
-
453
-
454
- <div id="constructor_details" class="method_details_list">
455
- <h2>Constructor Details</h2>
456
-
457
- <div class="method_details first">
458
- <h3 class="signature first" id="initialize-instance_method">
459
-
460
- #<strong>initialize</strong>(json) &#x21d2; <tt><span class='object_link'><a href="" title="Contentful::Field (class)">Field</a></span></tt>
461
-
462
-
463
-
464
-
465
-
466
- </h3><div class="docstring">
467
- <div class="discussion">
468
-
469
- <p>Returns a new instance of Field</p>
470
-
471
-
472
- </div>
473
- </div>
474
- <div class="tags">
475
-
476
-
477
- </div><table class="source_code">
478
- <tr>
479
- <td>
480
- <pre class="lines">
481
-
482
-
483
- 25
484
- 26
485
- 27
486
- 28
487
- 29
488
- 30
489
- 31
490
- 32
491
- 33
492
- 34</pre>
493
- </td>
494
- <td>
495
- <pre class="code"><span class="info file"># File 'lib/contentful/field.rb', line 25</span>
496
-
497
- <span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_json'>json</span><span class='rparen'>)</span>
498
- <span class='ivar'>@raw</span> <span class='op'>=</span> <span class='id identifier rubyid_json'>json</span>
499
- <span class='ivar'>@id</span> <span class='op'>=</span> <span class='id identifier rubyid_json'>json</span><span class='period'>.</span><span class='id identifier rubyid_fetch'>fetch</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>id</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span> <span class='kw'>nil</span><span class='rparen'>)</span>
500
- <span class='ivar'>@name</span> <span class='op'>=</span> <span class='id identifier rubyid_json'>json</span><span class='period'>.</span><span class='id identifier rubyid_fetch'>fetch</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>name</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span> <span class='kw'>nil</span><span class='rparen'>)</span>
501
- <span class='ivar'>@type</span> <span class='op'>=</span> <span class='id identifier rubyid_json'>json</span><span class='period'>.</span><span class='id identifier rubyid_fetch'>fetch</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>type</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span> <span class='kw'>nil</span><span class='rparen'>)</span>
502
- <span class='ivar'>@link_type</span> <span class='op'>=</span> <span class='id identifier rubyid_json'>json</span><span class='period'>.</span><span class='id identifier rubyid_fetch'>fetch</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>linkType</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span> <span class='kw'>nil</span><span class='rparen'>)</span>
503
- <span class='ivar'>@items</span> <span class='op'>=</span> <span class='id identifier rubyid_json'>json</span><span class='period'>.</span><span class='id identifier rubyid_key?'>key?</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>items</span><span class='tstring_end'>&#39;</span></span><span class='rparen'>)</span> <span class='op'>?</span> <span class='const'>Field</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_json'>json</span><span class='period'>.</span><span class='id identifier rubyid_fetch'>fetch</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>items</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span><span class='rparen'>)</span> <span class='op'>:</span> <span class='kw'>nil</span>
504
- <span class='ivar'>@required</span> <span class='op'>=</span> <span class='id identifier rubyid_json'>json</span><span class='period'>.</span><span class='id identifier rubyid_fetch'>fetch</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>required</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span> <span class='kw'>false</span><span class='rparen'>)</span>
505
- <span class='ivar'>@localized</span> <span class='op'>=</span> <span class='id identifier rubyid_json'>json</span><span class='period'>.</span><span class='id identifier rubyid_fetch'>fetch</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>localized</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span> <span class='kw'>false</span><span class='rparen'>)</span>
506
- <span class='kw'>end</span></pre>
507
- </td>
508
- </tr>
509
- </table>
510
- </div>
511
-
512
- </div>
513
-
514
- <div id="instance_attr_details" class="attr_details">
515
- <h2>Instance Attribute Details</h2>
516
-
517
-
518
- <span id=""></span>
519
- <div class="method_details first">
520
- <h3 class="signature first" id="id-instance_method">
521
-
522
- #<strong>id</strong> &#x21d2; <tt>Object</tt> <span class="extras">(readonly)</span>
523
-
524
-
525
-
526
-
527
-
528
- </h3><div class="docstring">
529
- <div class="discussion">
530
-
531
- <p>Returns the value of attribute id</p>
532
-
533
-
534
- </div>
535
- </div>
536
- <div class="tags">
537
-
538
-
539
- </div><table class="source_code">
540
- <tr>
541
- <td>
542
- <pre class="lines">
543
-
544
-
545
- 23
546
- 24
547
- 25</pre>
548
- </td>
549
- <td>
550
- <pre class="code"><span class="info file"># File 'lib/contentful/field.rb', line 23</span>
551
-
552
- <span class='kw'>def</span> <span class='id identifier rubyid_id'>id</span>
553
- <span class='ivar'>@id</span>
554
- <span class='kw'>end</span></pre>
555
- </td>
556
- </tr>
557
- </table>
558
- </div>
559
-
560
-
561
- <span id=""></span>
562
- <div class="method_details ">
563
- <h3 class="signature " id="items-instance_method">
564
-
565
- #<strong>items</strong> &#x21d2; <tt>Object</tt> <span class="extras">(readonly)</span>
566
-
567
-
568
-
569
-
570
-
571
- </h3><div class="docstring">
572
- <div class="discussion">
573
-
574
- <p>Returns the value of attribute items</p>
575
-
576
-
577
- </div>
578
- </div>
579
- <div class="tags">
580
-
581
-
582
- </div><table class="source_code">
583
- <tr>
584
- <td>
585
- <pre class="lines">
586
-
587
-
588
- 23
589
- 24
590
- 25</pre>
591
- </td>
592
- <td>
593
- <pre class="code"><span class="info file"># File 'lib/contentful/field.rb', line 23</span>
594
-
595
- <span class='kw'>def</span> <span class='id identifier rubyid_items'>items</span>
596
- <span class='ivar'>@items</span>
597
- <span class='kw'>end</span></pre>
598
- </td>
599
- </tr>
600
- </table>
601
- </div>
602
-
603
-
604
- <span id=""></span>
605
- <div class="method_details ">
606
- <h3 class="signature " id="link_type-instance_method">
607
-
608
- #<strong>link_type</strong> &#x21d2; <tt>Object</tt> <span class="extras">(readonly)</span>
609
-
610
-
611
-
612
-
613
-
614
- </h3><div class="docstring">
615
- <div class="discussion">
616
-
617
- <p>Returns the value of attribute link_type</p>
618
-
619
-
620
- </div>
621
- </div>
622
- <div class="tags">
623
-
624
-
625
- </div><table class="source_code">
626
- <tr>
627
- <td>
628
- <pre class="lines">
629
-
630
-
631
- 23
632
- 24
633
- 25</pre>
634
- </td>
635
- <td>
636
- <pre class="code"><span class="info file"># File 'lib/contentful/field.rb', line 23</span>
637
-
638
- <span class='kw'>def</span> <span class='id identifier rubyid_link_type'>link_type</span>
639
- <span class='ivar'>@link_type</span>
640
- <span class='kw'>end</span></pre>
641
- </td>
642
- </tr>
643
- </table>
644
- </div>
645
-
646
-
647
- <span id=""></span>
648
- <div class="method_details ">
649
- <h3 class="signature " id="localized-instance_method">
650
-
651
- #<strong>localized</strong> &#x21d2; <tt>Object</tt> <span class="extras">(readonly)</span>
652
-
653
-
654
-
655
-
656
-
657
- </h3><div class="docstring">
658
- <div class="discussion">
659
-
660
- <p>Returns the value of attribute localized</p>
661
-
662
-
663
- </div>
664
- </div>
665
- <div class="tags">
666
-
667
-
668
- </div><table class="source_code">
669
- <tr>
670
- <td>
671
- <pre class="lines">
672
-
673
-
674
- 23
675
- 24
676
- 25</pre>
677
- </td>
678
- <td>
679
- <pre class="code"><span class="info file"># File 'lib/contentful/field.rb', line 23</span>
680
-
681
- <span class='kw'>def</span> <span class='id identifier rubyid_localized'>localized</span>
682
- <span class='ivar'>@localized</span>
683
- <span class='kw'>end</span></pre>
684
- </td>
685
- </tr>
686
- </table>
687
- </div>
688
-
689
-
690
- <span id=""></span>
691
- <div class="method_details ">
692
- <h3 class="signature " id="name-instance_method">
693
-
694
- #<strong>name</strong> &#x21d2; <tt>Object</tt> <span class="extras">(readonly)</span>
695
-
696
-
697
-
698
-
699
-
700
- </h3><div class="docstring">
701
- <div class="discussion">
702
-
703
- <p>Returns the value of attribute name</p>
704
-
705
-
706
- </div>
707
- </div>
708
- <div class="tags">
709
-
710
-
711
- </div><table class="source_code">
712
- <tr>
713
- <td>
714
- <pre class="lines">
715
-
716
-
717
- 23
718
- 24
719
- 25</pre>
720
- </td>
721
- <td>
722
- <pre class="code"><span class="info file"># File 'lib/contentful/field.rb', line 23</span>
723
-
724
- <span class='kw'>def</span> <span class='id identifier rubyid_name'>name</span>
725
- <span class='ivar'>@name</span>
726
- <span class='kw'>end</span></pre>
727
- </td>
728
- </tr>
729
- </table>
730
- </div>
731
-
732
-
733
- <span id=""></span>
734
- <div class="method_details ">
735
- <h3 class="signature " id="raw-instance_method">
736
-
737
- #<strong>raw</strong> &#x21d2; <tt>Object</tt> <span class="extras">(readonly)</span>
738
-
739
-
740
-
741
-
742
-
743
- </h3><div class="docstring">
744
- <div class="discussion">
745
-
746
- <p>Returns the value of attribute raw</p>
747
-
748
-
749
- </div>
750
- </div>
751
- <div class="tags">
752
-
753
-
754
- </div><table class="source_code">
755
- <tr>
756
- <td>
757
- <pre class="lines">
758
-
759
-
760
- 23
761
- 24
762
- 25</pre>
763
- </td>
764
- <td>
765
- <pre class="code"><span class="info file"># File 'lib/contentful/field.rb', line 23</span>
766
-
767
- <span class='kw'>def</span> <span class='id identifier rubyid_raw'>raw</span>
768
- <span class='ivar'>@raw</span>
769
- <span class='kw'>end</span></pre>
770
- </td>
771
- </tr>
772
- </table>
773
- </div>
774
-
775
-
776
- <span id=""></span>
777
- <div class="method_details ">
778
- <h3 class="signature " id="required-instance_method">
779
-
780
- #<strong>required</strong> &#x21d2; <tt>Object</tt> <span class="extras">(readonly)</span>
781
-
782
-
783
-
784
-
785
-
786
- </h3><div class="docstring">
787
- <div class="discussion">
788
-
789
- <p>Returns the value of attribute required</p>
790
-
791
-
792
- </div>
793
- </div>
794
- <div class="tags">
795
-
796
-
797
- </div><table class="source_code">
798
- <tr>
799
- <td>
800
- <pre class="lines">
801
-
802
-
803
- 23
804
- 24
805
- 25</pre>
806
- </td>
807
- <td>
808
- <pre class="code"><span class="info file"># File 'lib/contentful/field.rb', line 23</span>
809
-
810
- <span class='kw'>def</span> <span class='id identifier rubyid_required'>required</span>
811
- <span class='ivar'>@required</span>
812
- <span class='kw'>end</span></pre>
813
- </td>
814
- </tr>
815
- </table>
816
- </div>
817
-
818
-
819
- <span id=""></span>
820
- <div class="method_details ">
821
- <h3 class="signature " id="type-instance_method">
822
-
823
- #<strong>type</strong> &#x21d2; <tt>Object</tt> <span class="extras">(readonly)</span>
824
-
825
-
826
-
827
-
828
-
829
- </h3><div class="docstring">
830
- <div class="discussion">
831
-
832
- <p>Returns the value of attribute type</p>
833
-
834
-
835
- </div>
836
- </div>
837
- <div class="tags">
838
-
839
-
840
- </div><table class="source_code">
841
- <tr>
842
- <td>
843
- <pre class="lines">
844
-
845
-
846
- 23
847
- 24
848
- 25</pre>
849
- </td>
850
- <td>
851
- <pre class="code"><span class="info file"># File 'lib/contentful/field.rb', line 23</span>
852
-
853
- <span class='kw'>def</span> <span class='id identifier rubyid_type'>type</span>
854
- <span class='ivar'>@type</span>
855
- <span class='kw'>end</span></pre>
856
- </td>
857
- </tr>
858
- </table>
859
- </div>
860
-
861
- </div>
862
-
863
-
864
- <div id="instance_method_details" class="method_details_list">
865
- <h2>Instance Method Details</h2>
866
-
867
-
868
- <div class="method_details first">
869
- <h3 class="signature first" id="coerce-instance_method">
870
-
871
- #<strong>coerce</strong>(value) &#x21d2; <tt>Object</tt>
872
-
873
-
874
-
875
-
876
-
877
- </h3><div class="docstring">
878
- <div class="discussion">
879
-
880
- <p>Coerces value to proper type</p>
881
-
882
-
883
- </div>
884
- </div>
885
- <div class="tags">
886
-
887
-
888
- </div><table class="source_code">
889
- <tr>
890
- <td>
891
- <pre class="lines">
892
-
893
-
894
- 37
895
- 38
896
- 39
897
- 40
898
- 41
899
- 42
900
- 43</pre>
901
- </td>
902
- <td>
903
- <pre class="code"><span class="info file"># File 'lib/contentful/field.rb', line 37</span>
904
-
905
- <span class='kw'>def</span> <span class='id identifier rubyid_coerce'>coerce</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span>
906
- <span class='kw'>return</span> <span class='id identifier rubyid_value'>value</span> <span class='kw'>if</span> <span class='id identifier rubyid_type'>type</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
907
-
908
- <span class='id identifier rubyid_options'>options</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
909
- <span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:coercion_class</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='const'>KNOWN_TYPES</span><span class='lbracket'>[</span><span class='id identifier rubyid_items'>items</span><span class='period'>.</span><span class='id identifier rubyid_type'>type</span><span class='rbracket'>]</span> <span class='kw'>unless</span> <span class='id identifier rubyid_items'>items</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
910
- <span class='const'>KNOWN_TYPES</span><span class='lbracket'>[</span><span class='id identifier rubyid_type'>type</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_coerce'>coerce</span>
911
- <span class='kw'>end</span></pre>
912
- </td>
913
- </tr>
914
- </table>
915
- </div>
916
-
917
- </div>
918
-
919
- </div>
920
-
921
- <div id="footer">
922
- Generated on Tue Jul 25 15:15:32 2017 by
923
- <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
924
- 0.9.5 (ruby-2.4.1).
925
- </div>
926
-
927
- </div>
928
- </body>
929
- </html>