contentful 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +1 -0
- data/ChangeLog.md +6 -0
- data/Gemfile +5 -0
- data/README.md +1 -0
- data/contentful.gemspec +1 -1
- data/lib/contentful/array.rb +1 -2
- data/lib/contentful/asset.rb +3 -3
- data/lib/contentful/client.rb +15 -18
- data/lib/contentful/content_type.rb +1 -1
- data/lib/contentful/dynamic_entry.rb +6 -6
- data/lib/contentful/entry.rb +1 -1
- data/lib/contentful/error.rb +3 -3
- data/lib/contentful/field.rb +1 -1
- data/lib/contentful/file.rb +1 -1
- data/lib/contentful/link.rb +2 -2
- data/lib/contentful/locale.rb +1 -1
- data/lib/contentful/location.rb +1 -1
- data/lib/contentful/resource.rb +10 -11
- data/lib/contentful/resource_builder.rb +63 -39
- data/lib/contentful/space.rb +1 -1
- data/lib/contentful/support.rb +5 -3
- data/lib/contentful/version.rb +1 -1
- data/spec/fixtures/json_responses/includes.json +111 -0
- data/spec/fixtures/json_responses/link_array.json +43 -0
- data/spec/resource_building_spec.rb +20 -0
- data/spec/spec_helper.rb +5 -1
- metadata +138 -192
- data/.README.md.swp +0 -0
- data/do_request.sh +0 -5
- data/doc/Contentful.html +0 -131
- data/doc/Contentful/AccessDenied.html +0 -158
- data/doc/Contentful/Array.html +0 -346
- data/doc/Contentful/Asset.html +0 -315
- data/doc/Contentful/BadRequest.html +0 -158
- data/doc/Contentful/Client.html +0 -1407
- data/doc/Contentful/ContentType.html +0 -183
- data/doc/Contentful/DynamicEntry.html +0 -333
- data/doc/Contentful/Entry.html +0 -198
- data/doc/Contentful/Error.html +0 -413
- data/doc/Contentful/Field.html +0 -161
- data/doc/Contentful/File.html +0 -160
- data/doc/Contentful/Link.html +0 -275
- data/doc/Contentful/Locale.html +0 -161
- data/doc/Contentful/NotFound.html +0 -158
- data/doc/Contentful/Request.html +0 -669
- data/doc/Contentful/Resource.html +0 -606
- data/doc/Contentful/Resource/AssetFields.html +0 -413
- data/doc/Contentful/Resource/AssetFields/ClassMethods.html +0 -174
- data/doc/Contentful/Resource/ClassMethods.html +0 -271
- data/doc/Contentful/Resource/Fields.html +0 -398
- data/doc/Contentful/Resource/Fields/ClassMethods.html +0 -187
- data/doc/Contentful/Resource/SystemProperties.html +0 -444
- data/doc/Contentful/Resource/SystemProperties/ClassMethods.html +0 -174
- data/doc/Contentful/ResourceBuilder.html +0 -1400
- data/doc/Contentful/Response.html +0 -546
- data/doc/Contentful/ServerError.html +0 -158
- data/doc/Contentful/Space.html +0 -183
- data/doc/Contentful/Support.html +0 -198
- data/doc/Contentful/Unauthorized.html +0 -158
- data/doc/Contentful/UnparsableJson.html +0 -158
- data/doc/Contentful/UnparsableResource.html +0 -158
- data/doc/_index.html +0 -410
- data/doc/class_list.html +0 -54
- data/doc/css/common.css +0 -1
- data/doc/css/full_list.css +0 -57
- data/doc/css/style.css +0 -338
- data/doc/file.README.html +0 -214
- data/doc/file_list.html +0 -56
- data/doc/frames.html +0 -26
- data/doc/index.html +0 -214
- data/doc/js/app.js +0 -219
- data/doc/js/full_list.js +0 -178
- data/doc/js/jquery.js +0 -4
- data/doc/method_list.html +0 -533
- data/doc/top-level-namespace.html +0 -112
@@ -1,271 +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
|
-
— Documentation by YARD 0.8.7.3
|
10
|
-
|
11
|
-
</title>
|
12
|
-
|
13
|
-
<link rel="stylesheet" href="../../css/style.css" type="text/css" charset="utf-8" />
|
14
|
-
|
15
|
-
<link rel="stylesheet" href="../../css/common.css" type="text/css" charset="utf-8" />
|
16
|
-
|
17
|
-
<script type="text/javascript" charset="utf-8">
|
18
|
-
hasFrames = window.top.frames.main ? true : false;
|
19
|
-
relpath = '../../';
|
20
|
-
framesUrl = "../../frames.html#!" + escape(window.location.href);
|
21
|
-
</script>
|
22
|
-
|
23
|
-
|
24
|
-
<script type="text/javascript" charset="utf-8" src="../../js/jquery.js"></script>
|
25
|
-
|
26
|
-
<script type="text/javascript" charset="utf-8" src="../../js/app.js"></script>
|
27
|
-
|
28
|
-
|
29
|
-
</head>
|
30
|
-
<body>
|
31
|
-
<div id="header">
|
32
|
-
<div id="menu">
|
33
|
-
|
34
|
-
<a href="../../_index.html">Index (C)</a> »
|
35
|
-
<span class='title'><span class='object_link'><a href="../../Contentful.html" title="Contentful (module)">Contentful</a></span></span> » <span class='title'><span class='object_link'><a href="../Resource.html" title="Contentful::Resource (module)">Resource</a></span></span>
|
36
|
-
»
|
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'></div></span>
|
157
|
-
|
158
|
-
</li>
|
159
|
-
|
160
|
-
|
161
|
-
</ul>
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
<div id="instance_method_details" class="method_details_list">
|
167
|
-
<h2>Instance Method Details</h2>
|
168
|
-
|
169
|
-
|
170
|
-
<div class="method_details first">
|
171
|
-
<h3 class="signature first" id="property-instance_method">
|
172
|
-
|
173
|
-
- (<tt>Object</tt>) <strong>property</strong>(name, property_class = nil)
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
</h3><div class="docstring">
|
180
|
-
<div class="discussion">
|
181
|
-
|
182
|
-
<p>Defines which properties of a resource your class expects Define them in
|
183
|
-
:camelCase, they will be available as #snake_cased methods</p>
|
184
|
-
|
185
|
-
<p>You can pass in a second "type" argument:</p>
|
186
|
-
<ul><li>
|
187
|
-
<p>If it is a class, it will be initialized for the property</p>
|
188
|
-
</li><li>
|
189
|
-
<p>Symbols are looked up in the COERCION constant for a lambda that defines a
|
190
|
-
type conversion to apply</p>
|
191
|
-
</li></ul>
|
192
|
-
|
193
|
-
<p>Note: This second argument is not meant for contentful sub-resources, but
|
194
|
-
for structured objects (like locales in a space) Sub-resources are handled
|
195
|
-
by the resource builder</p>
|
196
|
-
|
197
|
-
|
198
|
-
</div>
|
199
|
-
</div>
|
200
|
-
<div class="tags">
|
201
|
-
|
202
|
-
|
203
|
-
</div><table class="source_code">
|
204
|
-
<tr>
|
205
|
-
<td>
|
206
|
-
<pre class="lines">
|
207
|
-
|
208
|
-
|
209
|
-
92
|
210
|
-
93
|
211
|
-
94
|
212
|
-
95
|
213
|
-
96
|
214
|
-
97</pre>
|
215
|
-
</td>
|
216
|
-
<td>
|
217
|
-
<pre class="code"><span class="info file"># File 'lib/contentful/resource.rb', line 92</span>
|
218
|
-
|
219
|
-
<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>
|
220
|
-
<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>
|
221
|
-
<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>
|
222
|
-
<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>
|
223
|
-
<span class='kw'>end</span>
|
224
|
-
<span class='kw'>end</span></pre>
|
225
|
-
</td>
|
226
|
-
</tr>
|
227
|
-
</table>
|
228
|
-
</div>
|
229
|
-
|
230
|
-
<div class="method_details ">
|
231
|
-
<h3 class="signature " id="property_coercions-instance_method">
|
232
|
-
|
233
|
-
- (<tt>Object</tt>) <strong>property_coercions</strong>
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
</h3><table class="source_code">
|
240
|
-
<tr>
|
241
|
-
<td>
|
242
|
-
<pre class="lines">
|
243
|
-
|
244
|
-
|
245
|
-
77
|
246
|
-
78
|
247
|
-
79</pre>
|
248
|
-
</td>
|
249
|
-
<td>
|
250
|
-
<pre class="code"><span class="info file"># File 'lib/contentful/resource.rb', line 77</span>
|
251
|
-
|
252
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_property_coercions'>property_coercions</span>
|
253
|
-
<span class='ivar'>@property_coercions</span> <span class='op'>||=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
|
254
|
-
<span class='kw'>end</span></pre>
|
255
|
-
</td>
|
256
|
-
</tr>
|
257
|
-
</table>
|
258
|
-
</div>
|
259
|
-
|
260
|
-
</div>
|
261
|
-
|
262
|
-
</div>
|
263
|
-
|
264
|
-
<div id="footer">
|
265
|
-
Generated on Tue Mar 11 09:25:52 2014 by
|
266
|
-
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
267
|
-
0.8.7.3 (ruby-1.9.3).
|
268
|
-
</div>
|
269
|
-
|
270
|
-
</body>
|
271
|
-
</html>
|
@@ -1,398 +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::Fields
|
8
|
-
|
9
|
-
— Documentation by YARD 0.8.7.3
|
10
|
-
|
11
|
-
</title>
|
12
|
-
|
13
|
-
<link rel="stylesheet" href="../../css/style.css" type="text/css" charset="utf-8" />
|
14
|
-
|
15
|
-
<link rel="stylesheet" href="../../css/common.css" type="text/css" charset="utf-8" />
|
16
|
-
|
17
|
-
<script type="text/javascript" charset="utf-8">
|
18
|
-
hasFrames = window.top.frames.main ? true : false;
|
19
|
-
relpath = '../../';
|
20
|
-
framesUrl = "../../frames.html#!" + escape(window.location.href);
|
21
|
-
</script>
|
22
|
-
|
23
|
-
|
24
|
-
<script type="text/javascript" charset="utf-8" src="../../js/jquery.js"></script>
|
25
|
-
|
26
|
-
<script type="text/javascript" charset="utf-8" src="../../js/app.js"></script>
|
27
|
-
|
28
|
-
|
29
|
-
</head>
|
30
|
-
<body>
|
31
|
-
<div id="header">
|
32
|
-
<div id="menu">
|
33
|
-
|
34
|
-
<a href="../../_index.html">Index (F)</a> »
|
35
|
-
<span class='title'><span class='object_link'><a href="../../Contentful.html" title="Contentful (module)">Contentful</a></span></span> » <span class='title'><span class='object_link'><a href="../Resource.html" title="Contentful::Resource (module)">Resource</a></span></span>
|
36
|
-
»
|
37
|
-
<span class="title">Fields</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::Fields
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
</h1>
|
71
|
-
|
72
|
-
<dl class="box">
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
<dt class="r1">Included in:</dt>
|
81
|
-
<dd class="r1"><span class='object_link'><a href="../Entry.html" title="Contentful::Entry (class)">Entry</a></span></dd>
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
<dt class="r2 last">Defined in:</dt>
|
86
|
-
<dd class="r2 last">lib/contentful/resource/fields.rb</dd>
|
87
|
-
|
88
|
-
</dl>
|
89
|
-
<div class="clear"></div>
|
90
|
-
|
91
|
-
<h2>Overview</h2><div class="docstring">
|
92
|
-
<div class="discussion">
|
93
|
-
|
94
|
-
<p>Include this module into your Resource class to enable it to deal with
|
95
|
-
entry fields (but not asset fields)</p>
|
96
|
-
|
97
|
-
<p>It depends on system properties being available</p>
|
98
|
-
|
99
|
-
|
100
|
-
</div>
|
101
|
-
</div>
|
102
|
-
<div class="tags">
|
103
|
-
|
104
|
-
|
105
|
-
</div><h2>Defined Under Namespace</h2>
|
106
|
-
<p class="children">
|
107
|
-
|
108
|
-
|
109
|
-
<strong class="modules">Modules:</strong> <span class='object_link'><a href="Fields/ClassMethods.html" title="Contentful::Resource::Fields::ClassMethods (module)">ClassMethods</a></span>
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
</p>
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
<h2>
|
124
|
-
Class Method Summary
|
125
|
-
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
|
126
|
-
</h2>
|
127
|
-
|
128
|
-
<ul class="summary">
|
129
|
-
|
130
|
-
<li class="public ">
|
131
|
-
<span class="summary_signature">
|
132
|
-
|
133
|
-
<a href="#included-class_method" title="included (class method)">+ (Object) <strong>included</strong>(base) </a>
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
</span>
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
<span class="summary_desc"><div class='inline'></div></span>
|
148
|
-
|
149
|
-
</li>
|
150
|
-
|
151
|
-
|
152
|
-
</ul>
|
153
|
-
|
154
|
-
<h2>
|
155
|
-
Instance Method Summary
|
156
|
-
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
|
157
|
-
</h2>
|
158
|
-
|
159
|
-
<ul class="summary">
|
160
|
-
|
161
|
-
<li class="public ">
|
162
|
-
<span class="summary_signature">
|
163
|
-
|
164
|
-
<a href="#fields-instance_method" title="#fields (instance method)">- (Object) <strong>fields</strong> </a>
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
</span>
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
<span class="summary_desc"><div class='inline'>
|
179
|
-
<p>Returns all fields of the asset.</p>
|
180
|
-
</div></span>
|
181
|
-
|
182
|
-
</li>
|
183
|
-
|
184
|
-
|
185
|
-
<li class="public ">
|
186
|
-
<span class="summary_signature">
|
187
|
-
|
188
|
-
<a href="#initialize-instance_method" title="#initialize (instance method)">- (Object) <strong>initialize</strong>(object) </a>
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
</span>
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
<span class="summary_desc"><div class='inline'></div></span>
|
203
|
-
|
204
|
-
</li>
|
205
|
-
|
206
|
-
|
207
|
-
<li class="public ">
|
208
|
-
<span class="summary_signature">
|
209
|
-
|
210
|
-
<a href="#inspect-instance_method" title="#inspect (instance method)">- (Object) <strong>inspect</strong>(info = nil) </a>
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
</span>
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
<span class="summary_desc"><div class='inline'></div></span>
|
225
|
-
|
226
|
-
</li>
|
227
|
-
|
228
|
-
|
229
|
-
</ul>
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
<div id="class_method_details" class="method_details_list">
|
235
|
-
<h2>Class Method Details</h2>
|
236
|
-
|
237
|
-
|
238
|
-
<div class="method_details first">
|
239
|
-
<h3 class="signature first" id="included-class_method">
|
240
|
-
|
241
|
-
+ (<tt>Object</tt>) <strong>included</strong>(base)
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
</h3><table class="source_code">
|
248
|
-
<tr>
|
249
|
-
<td>
|
250
|
-
<pre class="lines">
|
251
|
-
|
252
|
-
|
253
|
-
34
|
254
|
-
35
|
255
|
-
36</pre>
|
256
|
-
</td>
|
257
|
-
<td>
|
258
|
-
<pre class="code"><span class="info file"># File 'lib/contentful/resource/fields.rb', line 34</span>
|
259
|
-
|
260
|
-
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_included'>included</span><span class='lparen'>(</span><span class='id identifier rubyid_base'>base</span><span class='rparen'>)</span>
|
261
|
-
<span class='id identifier rubyid_base'>base</span><span class='period'>.</span><span class='id identifier rubyid_extend'>extend</span><span class='lparen'>(</span><span class='const'>ClassMethods</span><span class='rparen'>)</span>
|
262
|
-
<span class='kw'>end</span></pre>
|
263
|
-
</td>
|
264
|
-
</tr>
|
265
|
-
</table>
|
266
|
-
</div>
|
267
|
-
|
268
|
-
</div>
|
269
|
-
|
270
|
-
<div id="instance_method_details" class="method_details_list">
|
271
|
-
<h2>Instance Method Details</h2>
|
272
|
-
|
273
|
-
|
274
|
-
<div class="method_details first">
|
275
|
-
<h3 class="signature first" id="fields-instance_method">
|
276
|
-
|
277
|
-
- (<tt>Object</tt>) <strong>fields</strong>
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
</h3><div class="docstring">
|
284
|
-
<div class="discussion">
|
285
|
-
|
286
|
-
<p>Returns all fields of the asset</p>
|
287
|
-
|
288
|
-
|
289
|
-
</div>
|
290
|
-
</div>
|
291
|
-
<div class="tags">
|
292
|
-
|
293
|
-
|
294
|
-
</div><table class="source_code">
|
295
|
-
<tr>
|
296
|
-
<td>
|
297
|
-
<pre class="lines">
|
298
|
-
|
299
|
-
|
300
|
-
9
|
301
|
-
10
|
302
|
-
11</pre>
|
303
|
-
</td>
|
304
|
-
<td>
|
305
|
-
<pre class="code"><span class="info file"># File 'lib/contentful/resource/fields.rb', line 9</span>
|
306
|
-
|
307
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_fields'>fields</span>
|
308
|
-
<span class='ivar'>@fields</span><span class='lbracket'>[</span><span class='id identifier rubyid_locale'>locale</span><span class='rbracket'>]</span>
|
309
|
-
<span class='kw'>end</span></pre>
|
310
|
-
</td>
|
311
|
-
</tr>
|
312
|
-
</table>
|
313
|
-
</div>
|
314
|
-
|
315
|
-
<div class="method_details ">
|
316
|
-
<h3 class="signature " id="initialize-instance_method">
|
317
|
-
|
318
|
-
- (<tt>Object</tt>) <strong>initialize</strong>(object)
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
</h3><table class="source_code">
|
325
|
-
<tr>
|
326
|
-
<td>
|
327
|
-
<pre class="lines">
|
328
|
-
|
329
|
-
|
330
|
-
13
|
331
|
-
14
|
332
|
-
15
|
333
|
-
16
|
334
|
-
17</pre>
|
335
|
-
</td>
|
336
|
-
<td>
|
337
|
-
<pre class="code"><span class="info file"># File 'lib/contentful/resource/fields.rb', line 13</span>
|
338
|
-
|
339
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_object'>object</span><span class='comma'>,</span> <span class='op'>*</span><span class='rparen'>)</span>
|
340
|
-
<span class='kw'>super</span>
|
341
|
-
<span class='ivar'>@fields</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
|
342
|
-
<span class='ivar'>@fields</span><span class='lbracket'>[</span><span class='id identifier rubyid_locale'>locale</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_extract_from_object'>extract_from_object</span> <span class='id identifier rubyid_object'>object</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>fields</span><span class='tstring_end'>"</span></span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='symbol'>:fields</span>
|
343
|
-
<span class='kw'>end</span></pre>
|
344
|
-
</td>
|
345
|
-
</tr>
|
346
|
-
</table>
|
347
|
-
</div>
|
348
|
-
|
349
|
-
<div class="method_details ">
|
350
|
-
<h3 class="signature " id="inspect-instance_method">
|
351
|
-
|
352
|
-
- (<tt>Object</tt>) <strong>inspect</strong>(info = nil)
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
</h3><table class="source_code">
|
359
|
-
<tr>
|
360
|
-
<td>
|
361
|
-
<pre class="lines">
|
362
|
-
|
363
|
-
|
364
|
-
19
|
365
|
-
20
|
366
|
-
21
|
367
|
-
22
|
368
|
-
23
|
369
|
-
24
|
370
|
-
25</pre>
|
371
|
-
</td>
|
372
|
-
<td>
|
373
|
-
<pre class="code"><span class="info file"># File 'lib/contentful/resource/fields.rb', line 19</span>
|
374
|
-
|
375
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_inspect'>inspect</span><span class='lparen'>(</span><span class='id identifier rubyid_info'>info</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='rparen'>)</span>
|
376
|
-
<span class='kw'>if</span> <span class='id identifier rubyid_fields'>fields</span><span class='period'>.</span><span class='id identifier rubyid_empty?'>empty?</span>
|
377
|
-
<span class='kw'>super</span><span class='lparen'>(</span><span class='id identifier rubyid_info'>info</span><span class='rparen'>)</span>
|
378
|
-
<span class='kw'>else</span>
|
379
|
-
<span class='kw'>super</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_info'>info</span><span class='rbrace'>}</span><span class='tstring_content'> @fields=</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_fields'>fields</span><span class='period'>.</span><span class='id identifier rubyid_inspect'>inspect</span><span class='rbrace'>}</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
|
380
|
-
<span class='kw'>end</span>
|
381
|
-
<span class='kw'>end</span></pre>
|
382
|
-
</td>
|
383
|
-
</tr>
|
384
|
-
</table>
|
385
|
-
</div>
|
386
|
-
|
387
|
-
</div>
|
388
|
-
|
389
|
-
</div>
|
390
|
-
|
391
|
-
<div id="footer">
|
392
|
-
Generated on Tue Mar 11 09:25:52 2014 by
|
393
|
-
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
394
|
-
0.8.7.3 (ruby-1.9.3).
|
395
|
-
</div>
|
396
|
-
|
397
|
-
</body>
|
398
|
-
</html>
|