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,244 +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::StringCoercion
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::StringCoercion";
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 (S)</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">StringCoercion</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::StringCoercion
65
-
66
-
67
-
68
- </h1>
69
- <div class="box_info">
70
-
71
- <dl>
72
- <dt>Inherits:</dt>
73
- <dd>
74
- <span class="inheritName"><span class='object_link'><a href="BaseCoercion.html" title="Contentful::BaseCoercion (class)">BaseCoercion</a></span></span>
75
-
76
- <ul class="fullTree">
77
- <li>Object</li>
78
-
79
- <li class="next"><span class='object_link'><a href="BaseCoercion.html" title="Contentful::BaseCoercion (class)">BaseCoercion</a></span></li>
80
-
81
- <li class="next">Contentful::StringCoercion</li>
82
-
83
- </ul>
84
- <a href="#" class="inheritanceTree">show all</a>
85
-
86
- </dd>
87
- </dl>
88
-
89
-
90
-
91
-
92
-
93
-
94
-
95
-
96
-
97
-
98
-
99
- <dl>
100
- <dt>Defined in:</dt>
101
- <dd>lib/contentful/coercions.rb</dd>
102
- </dl>
103
-
104
- </div>
105
-
106
- <h2>Overview</h2><div class="docstring">
107
- <div class="discussion">
108
-
109
- <p>Coercion for String Types</p>
110
-
111
-
112
- </div>
113
- </div>
114
- <div class="tags">
115
-
116
-
117
- </div><div id="subclasses">
118
- <h2>Direct Known Subclasses</h2>
119
- <p class="children"><span class='object_link'><a href="SymbolCoercion.html" title="Contentful::SymbolCoercion (class)">SymbolCoercion</a></span>, <span class='object_link'><a href="TextCoercion.html" title="Contentful::TextCoercion (class)">TextCoercion</a></span></p>
120
- </div>
121
-
122
-
123
-
124
-
125
-
126
-
127
- <h2>Instance Attribute Summary</h2>
128
-
129
- <h3 class="inherited">Attributes inherited from <span class='object_link'><a href="BaseCoercion.html" title="Contentful::BaseCoercion (class)">BaseCoercion</a></span></h3>
130
- <p class="inherited"><span class='object_link'><a href="BaseCoercion.html#options-instance_method" title="Contentful::BaseCoercion#options (method)">#options</a></span>, <span class='object_link'><a href="BaseCoercion.html#value-instance_method" title="Contentful::BaseCoercion#value (method)">#value</a></span></p>
131
-
132
-
133
-
134
- <h2>
135
- Instance Method Summary
136
- <small><a href="#" class="summary_toggle">collapse</a></small>
137
- </h2>
138
-
139
- <ul class="summary">
140
-
141
- <li class="public ">
142
- <span class="summary_signature">
143
-
144
- <a href="#coerce-instance_method" title="#coerce (instance method)">#<strong>coerce</strong> &#x21d2; Object </a>
145
-
146
-
147
-
148
- </span>
149
-
150
-
151
-
152
-
153
-
154
-
155
-
156
-
157
-
158
- <span class="summary_desc"><div class='inline'>
159
- <p>Coerces value to String.</p>
160
- </div></span>
161
-
162
- </li>
163
-
164
-
165
- </ul>
166
-
167
-
168
-
169
-
170
-
171
-
172
-
173
-
174
-
175
-
176
-
177
- <h3 class="inherited">Methods inherited from <span class='object_link'><a href="BaseCoercion.html" title="Contentful::BaseCoercion (class)">BaseCoercion</a></span></h3>
178
- <p class="inherited"><span class='object_link'><a href="BaseCoercion.html#initialize-instance_method" title="Contentful::BaseCoercion#initialize (method)">#initialize</a></span></p>
179
- <div id="constructor_details" class="method_details_list">
180
- <h2>Constructor Details</h2>
181
-
182
- <p class="notice">This class inherits a constructor from <span class='object_link'><a href="BaseCoercion.html#initialize-instance_method" title="Contentful::BaseCoercion#initialize (method)">Contentful::BaseCoercion</a></span></p>
183
-
184
- </div>
185
-
186
-
187
- <div id="instance_method_details" class="method_details_list">
188
- <h2>Instance Method Details</h2>
189
-
190
-
191
- <div class="method_details first">
192
- <h3 class="signature first" id="coerce-instance_method">
193
-
194
- #<strong>coerce</strong> &#x21d2; <tt>Object</tt>
195
-
196
-
197
-
198
-
199
-
200
- </h3><div class="docstring">
201
- <div class="discussion">
202
-
203
- <p>Coerces value to String</p>
204
-
205
-
206
- </div>
207
- </div>
208
- <div class="tags">
209
-
210
-
211
- </div><table class="source_code">
212
- <tr>
213
- <td>
214
- <pre class="lines">
215
-
216
-
217
- 21
218
- 22
219
- 23</pre>
220
- </td>
221
- <td>
222
- <pre class="code"><span class="info file"># File 'lib/contentful/coercions.rb', line 21</span>
223
-
224
- <span class='kw'>def</span> <span class='id identifier rubyid_coerce'>coerce</span>
225
- <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span>
226
- <span class='kw'>end</span></pre>
227
- </td>
228
- </tr>
229
- </table>
230
- </div>
231
-
232
- </div>
233
-
234
- </div>
235
-
236
- <div id="footer">
237
- Generated on Tue Jul 25 15:15:33 2017 by
238
- <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
239
- 0.9.5 (ruby-2.4.1).
240
- </div>
241
-
242
- </div>
243
- </body>
244
- </html>
@@ -1,550 +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::Support
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::Support";
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 (S)</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">Support</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::Support
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/support.rb</dd>
84
- </dl>
85
-
86
- </div>
87
-
88
- <h2>Overview</h2><div class="docstring">
89
- <div class="discussion">
90
-
91
- <p>Utility methods used by the contentful gem</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
- Class 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="#link%3F-class_method" title="link? (class method)">.<strong>link?</strong>(value) &#x21d2; true, false </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>Checks if value is a link.</p>
133
- </div></span>
134
-
135
- </li>
136
-
137
-
138
- <li class="public ">
139
- <span class="summary_signature">
140
-
141
- <a href="#link_array%3F-class_method" title="link_array? (class method)">.<strong>link_array?</strong>(value) &#x21d2; true, false </a>
142
-
143
-
144
-
145
- </span>
146
-
147
-
148
-
149
-
150
-
151
-
152
-
153
-
154
-
155
- <span class="summary_desc"><div class='inline'>
156
- <p>Checks if value is an array of links.</p>
157
- </div></span>
158
-
159
- </li>
160
-
161
-
162
- <li class="public ">
163
- <span class="summary_signature">
164
-
165
- <a href="#resource_for_link-class_method" title="resource_for_link (class method)">.<strong>resource_for_link</strong>(link, includes) &#x21d2; Hash </a>
166
-
167
-
168
-
169
- </span>
170
-
171
-
172
-
173
-
174
-
175
-
176
-
177
-
178
-
179
- <span class="summary_desc"><div class='inline'>
180
- <p>Returns the resource that matches the link.</p>
181
- </div></span>
182
-
183
- </li>
184
-
185
-
186
- <li class="public ">
187
- <span class="summary_signature">
188
-
189
- <a href="#snakify-class_method" title="snakify (class method)">.<strong>snakify</strong>(object) &#x21d2; String </a>
190
-
191
-
192
-
193
- </span>
194
-
195
-
196
-
197
-
198
-
199
-
200
-
201
-
202
-
203
- <span class="summary_desc"><div class='inline'>
204
- <p>Transforms CamelCase into snake_case (taken from zucker).</p>
205
- </div></span>
206
-
207
- </li>
208
-
209
-
210
- </ul>
211
-
212
-
213
-
214
-
215
- <div id="class_method_details" class="method_details_list">
216
- <h2>Class Method Details</h2>
217
-
218
-
219
- <div class="method_details first">
220
- <h3 class="signature first" id="link?-class_method">
221
-
222
- .<strong>link?</strong>(value) &#x21d2; <tt>true</tt>, <tt>false</tt>
223
-
224
-
225
-
226
-
227
-
228
- </h3><div class="docstring">
229
- <div class="discussion">
230
-
231
- <p>Checks if value is a link</p>
232
-
233
-
234
- </div>
235
- </div>
236
- <div class="tags">
237
- <p class="tag_title">Parameters:</p>
238
- <ul class="param">
239
-
240
- <li>
241
-
242
- <span class='name'>value</span>
243
-
244
-
245
- <span class='type'></span>
246
-
247
-
248
-
249
- </li>
250
-
251
- </ul>
252
-
253
- <p class="tag_title">Returns:</p>
254
- <ul class="return">
255
-
256
- <li>
257
-
258
-
259
- <span class='type'>(<tt>true</tt>, <tt>false</tt>)</span>
260
-
261
-
262
-
263
- </li>
264
-
265
- </ul>
266
-
267
- </div><table class="source_code">
268
- <tr>
269
- <td>
270
- <pre class="lines">
271
-
272
-
273
- 24
274
- 25
275
- 26
276
- 27</pre>
277
- </td>
278
- <td>
279
- <pre class="code"><span class="info file"># File 'lib/contentful/support.rb', line 24</span>
280
-
281
- <span class='kw'>def</span> <span class='id identifier rubyid_link?'>link?</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span>
282
- <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='op'>::</span><span class='const'>Hash</span><span class='rparen'>)</span> <span class='op'>&amp;&amp;</span>
283
- <span class='id identifier rubyid_value'>value</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'>sys</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='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='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_end'>&#39;</span></span><span class='rparen'>)</span> <span class='op'>==</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Link</span><span class='tstring_end'>&#39;</span></span>
284
- <span class='kw'>end</span></pre>
285
- </td>
286
- </tr>
287
- </table>
288
- </div>
289
-
290
- <div class="method_details ">
291
- <h3 class="signature " id="link_array?-class_method">
292
-
293
- .<strong>link_array?</strong>(value) &#x21d2; <tt>true</tt>, <tt>false</tt>
294
-
295
-
296
-
297
-
298
-
299
- </h3><div class="docstring">
300
- <div class="discussion">
301
-
302
- <p>Checks if value is an array of links</p>
303
-
304
-
305
- </div>
306
- </div>
307
- <div class="tags">
308
- <p class="tag_title">Parameters:</p>
309
- <ul class="param">
310
-
311
- <li>
312
-
313
- <span class='name'>value</span>
314
-
315
-
316
- <span class='type'></span>
317
-
318
-
319
-
320
- </li>
321
-
322
- </ul>
323
-
324
- <p class="tag_title">Returns:</p>
325
- <ul class="return">
326
-
327
- <li>
328
-
329
-
330
- <span class='type'>(<tt>true</tt>, <tt>false</tt>)</span>
331
-
332
-
333
-
334
- </li>
335
-
336
- </ul>
337
-
338
- </div><table class="source_code">
339
- <tr>
340
- <td>
341
- <pre class="lines">
342
-
343
-
344
- 34
345
- 35
346
- 36
347
- 37
348
- 38</pre>
349
- </td>
350
- <td>
351
- <pre class="code"><span class="info file"># File 'lib/contentful/support.rb', line 34</span>
352
-
353
- <span class='kw'>def</span> <span class='id identifier rubyid_link_array?'>link_array?</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span>
354
- <span class='kw'>return</span> <span class='id identifier rubyid_link?'>link?</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</span><span class='rparen'>)</span> <span class='kw'>if</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='op'>::</span><span class='const'>Array</span><span class='rparen'>)</span> <span class='op'>&amp;&amp;</span> <span class='op'>!</span><span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_empty?'>empty?</span>
355
-
356
- <span class='kw'>false</span>
357
- <span class='kw'>end</span></pre>
358
- </td>
359
- </tr>
360
- </table>
361
- </div>
362
-
363
- <div class="method_details ">
364
- <h3 class="signature " id="resource_for_link-class_method">
365
-
366
- .<strong>resource_for_link</strong>(link, includes) &#x21d2; <tt>Hash</tt>
367
-
368
-
369
-
370
-
371
-
372
- </h3><div class="docstring">
373
- <div class="discussion">
374
-
375
- <p>Returns the resource that matches the link</p>
376
-
377
-
378
- </div>
379
- </div>
380
- <div class="tags">
381
- <p class="tag_title">Parameters:</p>
382
- <ul class="param">
383
-
384
- <li>
385
-
386
- <span class='name'>link</span>
387
-
388
-
389
- <span class='type'>(<tt>Hash</tt>)</span>
390
-
391
-
392
-
393
- </li>
394
-
395
- <li>
396
-
397
- <span class='name'>includes</span>
398
-
399
-
400
- <span class='type'>(<tt><span class='object_link'><a href="Array.html" title="Contentful::Array (class)">::Array</a></span></tt>)</span>
401
-
402
-
403
-
404
- </li>
405
-
406
- </ul>
407
-
408
- <p class="tag_title">Returns:</p>
409
- <ul class="return">
410
-
411
- <li>
412
-
413
-
414
- <span class='type'>(<tt>Hash</tt>)</span>
415
-
416
-
417
-
418
- </li>
419
-
420
- </ul>
421
-
422
- </div><table class="source_code">
423
- <tr>
424
- <td>
425
- <pre class="lines">
426
-
427
-
428
- 46
429
- 47
430
- 48
431
- 49
432
- 50
433
- 51</pre>
434
- </td>
435
- <td>
436
- <pre class="code"><span class="info file"># File 'lib/contentful/support.rb', line 46</span>
437
-
438
- <span class='kw'>def</span> <span class='id identifier rubyid_resource_for_link'>resource_for_link</span><span class='lparen'>(</span><span class='id identifier rubyid_link'>link</span><span class='comma'>,</span> <span class='id identifier rubyid_includes'>includes</span><span class='rparen'>)</span>
439
- <span class='id identifier rubyid_includes'>includes</span><span class='period'>.</span><span class='id identifier rubyid_detect'>detect</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_i'>i</span><span class='op'>|</span>
440
- <span class='id identifier rubyid_i'>i</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>sys</span><span class='tstring_end'>&#39;</span></span><span class='rbracket'>]</span><span class='lbracket'>[</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='rbracket'>]</span> <span class='op'>==</span> <span class='id identifier rubyid_link'>link</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>sys</span><span class='tstring_end'>&#39;</span></span><span class='rbracket'>]</span><span class='lbracket'>[</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='rbracket'>]</span> <span class='op'>&amp;&amp;</span>
441
- <span class='id identifier rubyid_i'>i</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>sys</span><span class='tstring_end'>&#39;</span></span><span class='rbracket'>]</span><span class='lbracket'>[</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='rbracket'>]</span> <span class='op'>==</span> <span class='id identifier rubyid_link'>link</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>sys</span><span class='tstring_end'>&#39;</span></span><span class='rbracket'>]</span><span class='lbracket'>[</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='rbracket'>]</span>
442
- <span class='kw'>end</span>
443
- <span class='kw'>end</span></pre>
444
- </td>
445
- </tr>
446
- </table>
447
- </div>
448
-
449
- <div class="method_details ">
450
- <h3 class="signature " id="snakify-class_method">
451
-
452
- .<strong>snakify</strong>(object) &#x21d2; <tt>String</tt>
453
-
454
-
455
-
456
-
457
-
458
- </h3><div class="docstring">
459
- <div class="discussion">
460
-
461
- <p>Transforms CamelCase into snake_case (taken from zucker)</p>
462
-
463
-
464
- </div>
465
- </div>
466
- <div class="tags">
467
- <p class="tag_title">Parameters:</p>
468
- <ul class="param">
469
-
470
- <li>
471
-
472
- <span class='name'>object</span>
473
-
474
-
475
- <span class='type'>(<tt>String</tt>)</span>
476
-
477
-
478
-
479
- &mdash;
480
- <div class='inline'>
481
- <p>camelCaseName</p>
482
- </div>
483
-
484
- </li>
485
-
486
- </ul>
487
-
488
- <p class="tag_title">Returns:</p>
489
- <ul class="return">
490
-
491
- <li>
492
-
493
-
494
- <span class='type'>(<tt>String</tt>)</span>
495
-
496
-
497
-
498
- &mdash;
499
- <div class='inline'>
500
- <p>snake_case_name</p>
501
- </div>
502
-
503
- </li>
504
-
505
- </ul>
506
-
507
- </div><table class="source_code">
508
- <tr>
509
- <td>
510
- <pre class="lines">
511
-
512
-
513
- 10
514
- 11
515
- 12
516
- 13
517
- 14
518
- 15
519
- 16
520
- 17</pre>
521
- </td>
522
- <td>
523
- <pre class="code"><span class="info file"># File 'lib/contentful/support.rb', line 10</span>
524
-
525
- <span class='kw'>def</span> <span class='id identifier rubyid_snakify'>snakify</span><span class='lparen'>(</span><span class='id identifier rubyid_object'>object</span><span class='rparen'>)</span>
526
- <span class='const'>String</span><span class='lparen'>(</span><span class='id identifier rubyid_object'>object</span><span class='rparen'>)</span>
527
- <span class='period'>.</span><span class='id identifier rubyid_gsub'>gsub</span><span class='lparen'>(</span><span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>::</span><span class='regexp_end'>/</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>/</span><span class='tstring_end'>&#39;</span></span><span class='rparen'>)</span>
528
- <span class='period'>.</span><span class='id identifier rubyid_gsub'>gsub</span><span class='lparen'>(</span><span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>([A-Z]+)([A-Z][a-z])</span><span class='regexp_end'>/</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>\1_\2</span><span class='tstring_end'>&#39;</span></span><span class='rparen'>)</span>
529
- <span class='period'>.</span><span class='id identifier rubyid_gsub'>gsub</span><span class='lparen'>(</span><span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>([a-z\d])([A-Z])</span><span class='regexp_end'>/</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>\1_\2</span><span class='tstring_end'>&#39;</span></span><span class='rparen'>)</span>
530
- <span class='period'>.</span><span class='id identifier rubyid_tr'>tr</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>-</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>_</span><span class='tstring_end'>&#39;</span></span><span class='rparen'>)</span>
531
- <span class='period'>.</span><span class='id identifier rubyid_downcase'>downcase</span>
532
- <span class='kw'>end</span></pre>
533
- </td>
534
- </tr>
535
- </table>
536
- </div>
537
-
538
- </div>
539
-
540
- </div>
541
-
542
- <div id="footer">
543
- Generated on Tue Jul 25 15:15:32 2017 by
544
- <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
545
- 0.9.5 (ruby-2.4.1).
546
- </div>
547
-
548
- </div>
549
- </body>
550
- </html>