contentful 2.1.1 → 2.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (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,246 +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
- Module: Contentful::Resource::AssetFields
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::Resource::AssetFields";
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 (A)</a> &raquo;
40
- <span class='title'><span class='object_link'><a href="../../Contentful.html" title="Contentful (module)">Contentful</a></span></span> &raquo; <span class='title'><span class='object_link'><a href="../Resource.html" title="Contentful::Resource (module)">Resource</a></span></span>
41
- &raquo;
42
- <span class="title">AssetFields</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>Module: Contentful::Resource::AssetFields
65
-
66
-
67
-
68
- </h1>
69
- <div class="box_info">
70
-
71
-
72
-
73
-
74
-
75
-
76
-
77
-
78
-
79
-
80
-
81
- <dl>
82
- <dt>Defined in:</dt>
83
- <dd>lib/contentful/resource/asset_fields.rb</dd>
84
- </dl>
85
-
86
- </div>
87
-
88
- <h2>Overview</h2><div class="docstring">
89
- <div class="discussion">
90
-
91
- <p>Special fields for Asset. Don&#39;t include together wit
92
- Contentful::Resource::Fields</p>
93
-
94
- <p>It depends on system properties being available</p>
95
-
96
-
97
- </div>
98
- </div>
99
- <div class="tags">
100
-
101
-
102
- </div>
103
- <h2>Constant Summary</h2>
104
- <dl class="constants">
105
-
106
- <dt id="FIELDS_COERCIONS-constant" class="">FIELDS_COERCIONS =
107
- <div class="docstring">
108
- <div class="discussion">
109
-
110
- <p>Special field coercions for Asset.</p>
111
-
112
-
113
- </div>
114
- </div>
115
- <div class="tags">
116
-
117
-
118
- </div>
119
- </dt>
120
- <dd><pre class="code"><span class='lbrace'>{</span>
121
- <span class='label'>title:</span> <span class='symbol'>:string</span><span class='comma'>,</span>
122
- <span class='label'>description:</span> <span class='symbol'>:string</span><span class='comma'>,</span>
123
- <span class='label'>file:</span> <span class='const'>File</span>
124
- <span class='rbrace'>}</span></pre></dd>
125
-
126
- </dl>
127
-
128
-
129
-
130
-
131
-
132
-
133
-
134
-
135
- <h2>
136
- Instance Method Summary
137
- <small><a href="#" class="summary_toggle">collapse</a></small>
138
- </h2>
139
-
140
- <ul class="summary">
141
-
142
- <li class="public ">
143
- <span class="summary_signature">
144
-
145
- <a href="#fields-instance_method" title="#fields (instance method)">#<strong>fields</strong>(wanted_locale = default_locale) &#x21d2; Hash </a>
146
-
147
-
148
-
149
- </span>
150
-
151
-
152
-
153
-
154
-
155
-
156
-
157
-
158
-
159
- <span class="summary_desc"><div class='inline'>
160
- <p>Returns all fields of the asset.</p>
161
- </div></span>
162
-
163
- </li>
164
-
165
-
166
- </ul>
167
-
168
-
169
-
170
-
171
- <div id="instance_method_details" class="method_details_list">
172
- <h2>Instance Method Details</h2>
173
-
174
-
175
- <div class="method_details first">
176
- <h3 class="signature first" id="fields-instance_method">
177
-
178
- #<strong>fields</strong>(wanted_locale = default_locale) &#x21d2; <tt>Hash</tt>
179
-
180
-
181
-
182
-
183
-
184
- </h3><div class="docstring">
185
- <div class="discussion">
186
-
187
- <p>Returns all fields of the asset</p>
188
-
189
-
190
- </div>
191
- </div>
192
- <div class="tags">
193
-
194
- <p class="tag_title">Returns:</p>
195
- <ul class="return">
196
-
197
- <li>
198
-
199
-
200
- <span class='type'>(<tt>Hash</tt>)</span>
201
-
202
-
203
-
204
- &mdash;
205
- <div class='inline'>
206
- <p>localized fields</p>
207
- </div>
208
-
209
- </li>
210
-
211
- </ul>
212
-
213
- </div><table class="source_code">
214
- <tr>
215
- <td>
216
- <pre class="lines">
217
-
218
-
219
- 19
220
- 20
221
- 21</pre>
222
- </td>
223
- <td>
224
- <pre class="code"><span class="info file"># File 'lib/contentful/resource/asset_fields.rb', line 19</span>
225
-
226
- <span class='kw'>def</span> <span class='id identifier rubyid_fields'>fields</span><span class='lparen'>(</span><span class='id identifier rubyid_wanted_locale'>wanted_locale</span> <span class='op'>=</span> <span class='id identifier rubyid_default_locale'>default_locale</span><span class='rparen'>)</span>
227
- <span class='ivar'>@fields</span><span class='lbracket'>[</span><span class='id identifier rubyid_locale_for_non_localized'>locale_for_non_localized</span><span class='lparen'>(</span><span class='id identifier rubyid_wanted_locale'>wanted_locale</span><span class='rparen'>)</span><span class='rbracket'>]</span> <span class='op'>||</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
228
- <span class='kw'>end</span></pre>
229
- </td>
230
- </tr>
231
- </table>
232
- </div>
233
-
234
- </div>
235
-
236
- </div>
237
-
238
- <div id="footer">
239
- Generated on Fri Jan 6 17:57:03 2017 by
240
- <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
241
- 0.9.5 (ruby-2.3.1).
242
- </div>
243
-
244
- </div>
245
- </body>
246
- </html>
@@ -1,174 +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
- Module: Contentful::Resource::AssetFields::ClassMethods
8
-
9
- &mdash; Documentation by YARD 0.8.7.6
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#!Contentful/Resource/AssetFields/ClassMethods.html";
21
- </script>
22
-
23
-
24
- <script type="text/javascript" charset="utf-8" src="../../../js/jquery.js"></script>
25
-
26
- <script type="text/javascript" charset="utf-8" src="../../../js/app.js"></script>
27
-
28
-
29
- </head>
30
- <body>
31
- <div id="header">
32
- <div id="menu">
33
-
34
- <a href="../../../_index.html">Index (C)</a> &raquo;
35
- <span class='title'><span class='object_link'><a href="../../../Contentful.html" title="Contentful (module)">Contentful</a></span></span> &raquo; <span class='title'><span class='object_link'><a href="../../Resource.html" title="Contentful::Resource (module)">Resource</a></span></span> &raquo; <span class='title'><span class='object_link'><a href="../AssetFields.html" title="Contentful::Resource::AssetFields (module)">AssetFields</a></span></span>
36
- &raquo;
37
- <span class="title">ClassMethods</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>Module: Contentful::Resource::AssetFields::ClassMethods
67
-
68
-
69
-
70
- </h1>
71
-
72
- <dl class="box">
73
-
74
-
75
-
76
-
77
-
78
-
79
-
80
-
81
- <dt class="r1 last">Defined in:</dt>
82
- <dd class="r1 last">lib/contentful/resource/asset_fields.rb</dd>
83
-
84
- </dl>
85
- <div class="clear"></div>
86
-
87
-
88
-
89
-
90
-
91
-
92
-
93
-
94
-
95
- <h2>
96
- Instance Method Summary
97
- <small>(<a href="#" class="summary_toggle">collapse</a>)</small>
98
- </h2>
99
-
100
- <ul class="summary">
101
-
102
- <li class="public ">
103
- <span class="summary_signature">
104
-
105
- <a href="#fields_coercions-instance_method" title="#fields_coercions (instance method)">- (Object) <strong>fields_coercions</strong> </a>
106
-
107
-
108
-
109
- </span>
110
-
111
-
112
-
113
-
114
-
115
-
116
-
117
-
118
-
119
- <span class="summary_desc"><div class='inline'></div></span>
120
-
121
- </li>
122
-
123
-
124
- </ul>
125
-
126
-
127
-
128
-
129
- <div id="instance_method_details" class="method_details_list">
130
- <h2>Instance Method Details</h2>
131
-
132
-
133
- <div class="method_details first">
134
- <h3 class="signature first" id="fields_coercions-instance_method">
135
-
136
- - (<tt>Object</tt>) <strong>fields_coercions</strong>
137
-
138
-
139
-
140
-
141
-
142
- </h3><table class="source_code">
143
- <tr>
144
- <td>
145
- <pre class="lines">
146
-
147
-
148
- 35
149
- 36
150
- 37</pre>
151
- </td>
152
- <td>
153
- <pre class="code"><span class="info file"># File 'lib/contentful/resource/asset_fields.rb', line 35</span>
154
-
155
- <span class='kw'>def</span> <span class='id identifier rubyid_fields_coercions'>fields_coercions</span>
156
- <span class='const'>FIELDS_COERCIONS</span>
157
- <span class='kw'>end</span></pre>
158
- </td>
159
- </tr>
160
- </table>
161
- </div>
162
-
163
- </div>
164
-
165
- </div>
166
-
167
- <div id="footer">
168
- Generated on Tue Feb 2 13:12:34 2016 by
169
- <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
170
- 0.8.7.6 (ruby-2.2.3).
171
- </div>
172
-
173
- </body>
174
- </html>
@@ -1,378 +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
- Module: Contentful::Resource::ClassMethods
8
-
9
- &mdash; Documentation by YARD 0.8.7.6
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#!Contentful/Resource/ClassMethods.html";
21
- </script>
22
-
23
-
24
- <script type="text/javascript" charset="utf-8" src="../../js/jquery.js"></script>
25
-
26
- <script type="text/javascript" charset="utf-8" src="../../js/app.js"></script>
27
-
28
-
29
- </head>
30
- <body>
31
- <div id="header">
32
- <div id="menu">
33
-
34
- <a href="../../_index.html">Index (C)</a> &raquo;
35
- <span class='title'><span class='object_link'><a href="../../Contentful.html" title="Contentful (module)">Contentful</a></span></span> &raquo; <span class='title'><span class='object_link'><a href="../Resource.html" title="Contentful::Resource (module)">Resource</a></span></span>
36
- &raquo;
37
- <span class="title">ClassMethods</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>Module: Contentful::Resource::ClassMethods
67
-
68
-
69
-
70
- </h1>
71
-
72
- <dl class="box">
73
-
74
-
75
-
76
-
77
-
78
-
79
-
80
-
81
- <dt class="r1 last">Defined in:</dt>
82
- <dd class="r1 last">lib/contentful/resource.rb</dd>
83
-
84
- </dl>
85
- <div class="clear"></div>
86
-
87
- <h2>Overview</h2><div class="docstring">
88
- <div class="discussion">
89
-
90
- <p>Register the resources properties on class level by using the #property
91
- method</p>
92
-
93
-
94
- </div>
95
- </div>
96
- <div class="tags">
97
-
98
-
99
- </div>
100
-
101
-
102
-
103
-
104
-
105
-
106
-
107
- <h2>
108
- Instance Method Summary
109
- <small>(<a href="#" class="summary_toggle">collapse</a>)</small>
110
- </h2>
111
-
112
- <ul class="summary">
113
-
114
- <li class="public ">
115
- <span class="summary_signature">
116
-
117
- <a href="#property-instance_method" title="#property (instance method)">- (Object) <strong>property</strong>(name, property_class = nil) </a>
118
-
119
-
120
-
121
- </span>
122
-
123
-
124
-
125
-
126
-
127
-
128
-
129
-
130
-
131
- <span class="summary_desc"><div class='inline'>
132
- <p>Defines which properties of a resource your class expects Define them in
133
- :camelCase, they will be available as #snake_cased methods.</p>
134
- </div></span>
135
-
136
- </li>
137
-
138
-
139
- <li class="public ">
140
- <span class="summary_signature">
141
-
142
- <a href="#property_coercions-instance_method" title="#property_coercions (instance method)">- (Object) <strong>property_coercions</strong> </a>
143
-
144
-
145
-
146
- </span>
147
-
148
-
149
-
150
-
151
-
152
-
153
-
154
-
155
-
156
- <span class="summary_desc"><div class='inline'>
157
- <p>By default, fields come flattened in the current locale.</p>
158
- </div></span>
159
-
160
- </li>
161
-
162
-
163
- <li class="public ">
164
- <span class="summary_signature">
165
-
166
- <a href="#update_coercions%21-instance_method" title="#update_coercions! (instance method)">- (Object) <strong>update_coercions!</strong> </a>
167
-
168
-
169
-
170
- </span>
171
-
172
-
173
-
174
-
175
-
176
-
177
-
178
-
179
-
180
- <span class="summary_desc"><div class='inline'>
181
- <p>Ensure inherited classes pick up coercions.</p>
182
- </div></span>
183
-
184
- </li>
185
-
186
-
187
- </ul>
188
-
189
-
190
-
191
-
192
- <div id="instance_method_details" class="method_details_list">
193
- <h2>Instance Method Details</h2>
194
-
195
-
196
- <div class="method_details first">
197
- <h3 class="signature first" id="property-instance_method">
198
-
199
- - (<tt>Object</tt>) <strong>property</strong>(name, property_class = nil)
200
-
201
-
202
-
203
-
204
-
205
- </h3><div class="docstring">
206
- <div class="discussion">
207
-
208
- <p>Defines which properties of a resource your class expects Define them in
209
- :camelCase, they will be available as #snake_cased methods</p>
210
-
211
- <p>You can pass in a second “type” argument:</p>
212
- <ul><li>
213
- <p>If it is a class, it will be initialized for the property</p>
214
- </li><li>
215
- <p>Symbols are looked up in the COERCION constant for a lambda that defines a
216
- type conversion to apply</p>
217
- </li></ul>
218
-
219
- <p>Note: This second argument is not meant for contentful sub-resources, but
220
- for structured objects (like locales in a space) Sub-resources are handled
221
- by the resource builder</p>
222
-
223
-
224
- </div>
225
- </div>
226
- <div class="tags">
227
-
228
-
229
- </div><table class="source_code">
230
- <tr>
231
- <td>
232
- <pre class="lines">
233
-
234
-
235
- 191
236
- 192
237
- 193
238
- 194
239
- 195
240
- 196</pre>
241
- </td>
242
- <td>
243
- <pre class="code"><span class="info file"># File 'lib/contentful/resource.rb', line 191</span>
244
-
245
- <span class='kw'>def</span> <span class='id identifier rubyid_property'>property</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='comma'>,</span> <span class='id identifier rubyid_property_class'>property_class</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='rparen'>)</span>
246
- <span class='id identifier rubyid_property_coercions'>property_coercions</span><span class='lbracket'>[</span><span class='id identifier rubyid_name'>name</span><span class='period'>.</span><span class='id identifier rubyid_to_sym'>to_sym</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_property_class'>property_class</span>
247
- <span class='id identifier rubyid_define_method'>define_method</span> <span class='const'>Contentful</span><span class='op'>::</span><span class='const'>Support</span><span class='period'>.</span><span class='id identifier rubyid_snakify'>snakify</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='rparen'>)</span> <span class='kw'>do</span>
248
- <span class='id identifier rubyid_properties'>properties</span><span class='lbracket'>[</span><span class='id identifier rubyid_name'>name</span><span class='period'>.</span><span class='id identifier rubyid_to_sym'>to_sym</span><span class='rbracket'>]</span>
249
- <span class='kw'>end</span>
250
- <span class='kw'>end</span></pre>
251
- </td>
252
- </tr>
253
- </table>
254
- </div>
255
-
256
- <div class="method_details ">
257
- <h3 class="signature " id="property_coercions-instance_method">
258
-
259
- - (<tt>Object</tt>) <strong>property_coercions</strong>
260
-
261
-
262
-
263
-
264
-
265
- </h3><div class="docstring">
266
- <div class="discussion">
267
-
268
- <p>By default, fields come flattened in the current locale. This is different
269
- for sync</p>
270
-
271
-
272
- </div>
273
- </div>
274
- <div class="tags">
275
-
276
-
277
- </div><table class="source_code">
278
- <tr>
279
- <td>
280
- <pre class="lines">
281
-
282
-
283
- 176
284
- 177
285
- 178</pre>
286
- </td>
287
- <td>
288
- <pre class="code"><span class="info file"># File 'lib/contentful/resource.rb', line 176</span>
289
-
290
- <span class='kw'>def</span> <span class='id identifier rubyid_property_coercions'>property_coercions</span>
291
- <span class='ivar'>@property_coercions</span> <span class='op'>||=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
292
- <span class='kw'>end</span></pre>
293
- </td>
294
- </tr>
295
- </table>
296
- </div>
297
-
298
- <div class="method_details ">
299
- <h3 class="signature " id="update_coercions!-instance_method">
300
-
301
- - (<tt>Object</tt>) <strong>update_coercions!</strong>
302
-
303
-
304
-
305
-
306
-
307
- </h3><div class="docstring">
308
- <div class="discussion">
309
-
310
- <p>Ensure inherited classes pick up coercions</p>
311
-
312
-
313
- </div>
314
- </div>
315
- <div class="tags">
316
-
317
-
318
- </div><table class="source_code">
319
- <tr>
320
- <td>
321
- <pre class="lines">
322
-
323
-
324
- 199
325
- 200
326
- 201
327
- 202
328
- 203
329
- 204
330
- 205
331
- 206
332
- 207
333
- 208
334
- 209
335
- 210
336
- 211
337
- 212
338
- 213
339
- 214
340
- 215</pre>
341
- </td>
342
- <td>
343
- <pre class="code"><span class="info file"># File 'lib/contentful/resource.rb', line 199</span>
344
-
345
- <span class='kw'>def</span> <span class='id identifier rubyid_update_coercions!'>update_coercions!</span>
346
- <span class='kw'>return</span> <span class='kw'>if</span> <span class='ivar'>@coercions_updated</span>
347
-
348
- <span class='kw'>if</span> <span class='id identifier rubyid_superclass'>superclass</span><span class='period'>.</span><span class='id identifier rubyid_respond_to?'>respond_to?</span> <span class='symbol'>:property_coercions</span>
349
- <span class='ivar'>@property_coercions</span> <span class='op'>=</span> <span class='id identifier rubyid_superclass'>superclass</span><span class='period'>.</span><span class='id identifier rubyid_property_coercions'>property_coercions</span><span class='period'>.</span><span class='id identifier rubyid_dup'>dup</span><span class='period'>.</span><span class='id identifier rubyid_merge'>merge</span><span class='lparen'>(</span><span class='ivar'>@property_coercions</span> <span class='op'>||</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
350
- <span class='kw'>end</span>
351
-
352
- <span class='kw'>if</span> <span class='id identifier rubyid_superclass'>superclass</span><span class='period'>.</span><span class='id identifier rubyid_respond_to?'>respond_to?</span> <span class='symbol'>:sys_coercions</span>
353
- <span class='ivar'>@sys_coercions</span> <span class='op'>=</span> <span class='id identifier rubyid_superclass'>superclass</span><span class='period'>.</span><span class='id identifier rubyid_sys_coercions'>sys_coercions</span><span class='period'>.</span><span class='id identifier rubyid_dup'>dup</span><span class='period'>.</span><span class='id identifier rubyid_merge'>merge</span><span class='lparen'>(</span><span class='ivar'>@sys_coercions</span> <span class='op'>||</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
354
- <span class='kw'>end</span>
355
-
356
- <span class='kw'>if</span> <span class='id identifier rubyid_superclass'>superclass</span><span class='period'>.</span><span class='id identifier rubyid_respond_to?'>respond_to?</span> <span class='symbol'>:fields_coercions</span>
357
- <span class='ivar'>@fields_coercions</span> <span class='op'>=</span> <span class='id identifier rubyid_superclass'>superclass</span><span class='period'>.</span><span class='id identifier rubyid_fields_coercions'>fields_coercions</span><span class='period'>.</span><span class='id identifier rubyid_dup'>dup</span><span class='period'>.</span><span class='id identifier rubyid_merge'>merge</span><span class='lparen'>(</span><span class='ivar'>@fields_coercions</span> <span class='op'>||</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
358
- <span class='kw'>end</span>
359
-
360
- <span class='ivar'>@coercions_updated</span> <span class='op'>=</span> <span class='kw'>true</span>
361
- <span class='kw'>end</span></pre>
362
- </td>
363
- </tr>
364
- </table>
365
- </div>
366
-
367
- </div>
368
-
369
- </div>
370
-
371
- <div id="footer">
372
- Generated on Tue Feb 2 13:24:45 2016 by
373
- <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
374
- 0.8.7.6 (ruby-2.2.3).
375
- </div>
376
-
377
- </body>
378
- </html>