dynamoid 0.6.1 → 0.7.0
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.
- data/.travis.yml +4 -0
- data/Gemfile +3 -2
- data/Gemfile.lock +40 -45
- data/README.markdown +55 -25
- data/Rakefile +31 -0
- data/VERSION +1 -1
- data/doc/Dynamoid.html +58 -42
- data/doc/Dynamoid/Adapter.html +666 -179
- data/doc/Dynamoid/Adapter/AwsSdk.html +752 -236
- data/doc/Dynamoid/Associations.html +28 -21
- data/doc/Dynamoid/Associations/Association.html +102 -49
- data/doc/Dynamoid/Associations/BelongsTo.html +28 -25
- data/doc/Dynamoid/Associations/ClassMethods.html +95 -52
- data/doc/Dynamoid/Associations/HasAndBelongsToMany.html +28 -25
- data/doc/Dynamoid/Associations/HasMany.html +28 -25
- data/doc/Dynamoid/Associations/HasOne.html +28 -25
- data/doc/Dynamoid/Associations/ManyAssociation.html +138 -94
- data/doc/Dynamoid/Associations/SingleAssociation.html +67 -38
- data/doc/Dynamoid/Components.html +60 -22
- data/doc/Dynamoid/Config.html +61 -44
- data/doc/Dynamoid/Config/Options.html +90 -61
- data/doc/Dynamoid/Criteria.html +28 -21
- data/doc/Dynamoid/Criteria/Chain.html +508 -100
- data/doc/Dynamoid/Criteria/ClassMethods.html +26 -19
- data/doc/Dynamoid/Dirty.html +424 -0
- data/doc/Dynamoid/Dirty/ClassMethods.html +174 -0
- data/doc/Dynamoid/Document.html +451 -84
- data/doc/Dynamoid/Document/ClassMethods.html +281 -102
- data/doc/Dynamoid/Errors.html +29 -22
- data/doc/Dynamoid/Errors/ConditionalCheckFailedException.html +141 -0
- data/doc/Dynamoid/Errors/DocumentNotValid.html +36 -25
- data/doc/Dynamoid/Errors/Error.html +27 -20
- data/doc/Dynamoid/Errors/InvalidField.html +27 -19
- data/doc/Dynamoid/Errors/InvalidQuery.html +131 -0
- data/doc/Dynamoid/Errors/MissingRangeKey.html +27 -19
- data/doc/Dynamoid/Fields.html +94 -77
- data/doc/Dynamoid/Fields/ClassMethods.html +166 -37
- data/doc/Dynamoid/Finders.html +28 -21
- data/doc/Dynamoid/Finders/ClassMethods.html +505 -78
- data/doc/Dynamoid/IdentityMap.html +492 -0
- data/doc/Dynamoid/IdentityMap/ClassMethods.html +534 -0
- data/doc/Dynamoid/Indexes.html +41 -28
- data/doc/Dynamoid/Indexes/ClassMethods.html +45 -29
- data/doc/Dynamoid/Indexes/Index.html +100 -62
- data/doc/Dynamoid/Middleware.html +115 -0
- data/doc/Dynamoid/Middleware/IdentityMap.html +264 -0
- data/doc/Dynamoid/Persistence.html +326 -85
- data/doc/Dynamoid/Persistence/ClassMethods.html +275 -109
- data/doc/Dynamoid/Validations.html +47 -31
- data/doc/_index.html +116 -71
- data/doc/class_list.html +13 -7
- data/doc/css/full_list.css +4 -2
- data/doc/css/style.css +60 -44
- data/doc/file.LICENSE.html +26 -19
- data/doc/file.README.html +152 -48
- data/doc/file_list.html +14 -8
- data/doc/frames.html +20 -5
- data/doc/index.html +152 -48
- data/doc/js/app.js +52 -43
- data/doc/js/full_list.js +14 -9
- data/doc/js/jquery.js +4 -16
- data/doc/method_list.html +446 -540
- data/doc/top-level-namespace.html +27 -20
- data/{Dynamoid.gemspec → dynamoid.gemspec} +21 -8
- data/lib/dynamoid/adapter.rb +11 -10
- data/lib/dynamoid/adapter/aws_sdk.rb +40 -19
- data/lib/dynamoid/components.rb +2 -1
- data/lib/dynamoid/criteria/chain.rb +29 -11
- data/lib/dynamoid/dirty.rb +6 -0
- data/lib/dynamoid/document.rb +34 -19
- data/lib/dynamoid/fields.rb +36 -30
- data/lib/dynamoid/finders.rb +7 -5
- data/lib/dynamoid/persistence.rb +37 -10
- data/spec/app/models/address.rb +2 -0
- data/spec/app/models/camel_case.rb +10 -0
- data/spec/app/models/car.rb +6 -0
- data/spec/app/models/nuclear_submarine.rb +5 -0
- data/spec/app/models/subscription.rb +2 -2
- data/spec/app/models/vehicle.rb +7 -0
- data/spec/dynamoid/adapter/aws_sdk_spec.rb +20 -11
- data/spec/dynamoid/adapter_spec.rb +67 -82
- data/spec/dynamoid/associations/association_spec.rb +30 -30
- data/spec/dynamoid/criteria/chain_spec.rb +56 -9
- data/spec/dynamoid/criteria_spec.rb +3 -0
- data/spec/dynamoid/dirty_spec.rb +8 -0
- data/spec/dynamoid/document_spec.rb +109 -47
- data/spec/dynamoid/fields_spec.rb +32 -3
- data/spec/dynamoid/finders_spec.rb +12 -0
- data/spec/dynamoid/persistence_spec.rb +73 -8
- data/spec/spec_helper.rb +1 -0
- data/spec/support/with_partitioning.rb +15 -0
- metadata +22 -9
|
@@ -6,19 +6,21 @@
|
|
|
6
6
|
<title>
|
|
7
7
|
Module: Dynamoid::Fields::ClassMethods
|
|
8
8
|
|
|
9
|
-
— Documentation by YARD 0.
|
|
9
|
+
— Documentation by YARD 0.8.6.1
|
|
10
10
|
|
|
11
11
|
</title>
|
|
12
12
|
|
|
13
|
-
<link rel="stylesheet" href="../../css/style.css" type="text/css"
|
|
13
|
+
<link rel="stylesheet" href="../../css/style.css" type="text/css" charset="utf-8" />
|
|
14
14
|
|
|
15
|
-
<link rel="stylesheet" href="../../css/common.css" type="text/css"
|
|
15
|
+
<link rel="stylesheet" href="../../css/common.css" type="text/css" charset="utf-8" />
|
|
16
16
|
|
|
17
17
|
<script type="text/javascript" charset="utf-8">
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
hasFrames = window.top.frames.main ? true : false;
|
|
19
|
+
relpath = '../../';
|
|
20
|
+
framesUrl = "../../frames.html#!" + escape(window.location.href);
|
|
20
21
|
</script>
|
|
21
22
|
|
|
23
|
+
|
|
22
24
|
<script type="text/javascript" charset="utf-8" src="../../js/jquery.js"></script>
|
|
23
25
|
|
|
24
26
|
<script type="text/javascript" charset="utf-8" src="../../js/app.js"></script>
|
|
@@ -26,36 +28,41 @@
|
|
|
26
28
|
|
|
27
29
|
</head>
|
|
28
30
|
<body>
|
|
29
|
-
<script type="text/javascript" charset="utf-8">
|
|
30
|
-
if (window.top.frames.main) document.body.className = 'frames';
|
|
31
|
-
</script>
|
|
32
|
-
|
|
33
31
|
<div id="header">
|
|
34
32
|
<div id="menu">
|
|
35
33
|
|
|
36
|
-
<a href="../../_index.html">Index (C)</a> »
|
|
34
|
+
<a href="../../_index.html">Index (C)</a> »
|
|
37
35
|
<span class='title'><span class='object_link'><a href="../../Dynamoid.html" title="Dynamoid (module)">Dynamoid</a></span></span> » <span class='title'><span class='object_link'><a href="../Fields.html" title="Dynamoid::Fields (module)">Fields</a></span></span>
|
|
38
36
|
»
|
|
39
37
|
<span class="title">ClassMethods</span>
|
|
40
38
|
|
|
41
|
-
|
|
39
|
+
|
|
42
40
|
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
|
43
41
|
</div>
|
|
44
42
|
|
|
45
43
|
<div id="search">
|
|
46
44
|
|
|
47
|
-
<a
|
|
45
|
+
<a class="full_list_link" id="class_list_link"
|
|
46
|
+
href="../../class_list.html">
|
|
47
|
+
Class List
|
|
48
|
+
</a>
|
|
48
49
|
|
|
49
|
-
<a
|
|
50
|
+
<a class="full_list_link" id="method_list_link"
|
|
51
|
+
href="../../method_list.html">
|
|
52
|
+
Method List
|
|
53
|
+
</a>
|
|
50
54
|
|
|
51
|
-
<a
|
|
55
|
+
<a class="full_list_link" id="file_list_link"
|
|
56
|
+
href="../../file_list.html">
|
|
57
|
+
File List
|
|
58
|
+
</a>
|
|
52
59
|
|
|
53
60
|
</div>
|
|
54
61
|
<div class="clear"></div>
|
|
55
62
|
</div>
|
|
56
|
-
|
|
63
|
+
|
|
57
64
|
<iframe id="search_frame"></iframe>
|
|
58
|
-
|
|
65
|
+
|
|
59
66
|
<div id="content"><h1>Module: Dynamoid::Fields::ClassMethods
|
|
60
67
|
|
|
61
68
|
|
|
@@ -106,6 +113,7 @@
|
|
|
106
113
|
|
|
107
114
|
|
|
108
115
|
|
|
116
|
+
|
|
109
117
|
|
|
110
118
|
|
|
111
119
|
<span class="summary_desc"><div class='inline'><p>Specify a field for a document.</p>
|
|
@@ -128,6 +136,51 @@
|
|
|
128
136
|
|
|
129
137
|
|
|
130
138
|
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
|
143
|
+
|
|
144
|
+
</li>
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+
<li class="public ">
|
|
148
|
+
<span class="summary_signature">
|
|
149
|
+
|
|
150
|
+
<a href="#remove_field-instance_method" title="#remove_field (instance method)">- (Object) <strong>remove_field</strong>(field) </a>
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
</span>
|
|
155
|
+
|
|
156
|
+
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
|
|
160
|
+
|
|
161
|
+
|
|
162
|
+
|
|
163
|
+
|
|
164
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
|
165
|
+
|
|
166
|
+
</li>
|
|
167
|
+
|
|
168
|
+
|
|
169
|
+
<li class="public ">
|
|
170
|
+
<span class="summary_signature">
|
|
171
|
+
|
|
172
|
+
<a href="#table-instance_method" title="#table (instance method)">- (Object) <strong>table</strong>(options) </a>
|
|
173
|
+
|
|
174
|
+
|
|
175
|
+
|
|
176
|
+
</span>
|
|
177
|
+
|
|
178
|
+
|
|
179
|
+
|
|
180
|
+
|
|
181
|
+
|
|
182
|
+
|
|
183
|
+
|
|
131
184
|
|
|
132
185
|
|
|
133
186
|
<span class="summary_desc"><div class='inline'></div></span>
|
|
@@ -142,25 +195,27 @@
|
|
|
142
195
|
|
|
143
196
|
<div id="instance_method_details" class="method_details_list">
|
|
144
197
|
<h2>Instance Method Details</h2>
|
|
145
|
-
|
|
198
|
+
|
|
146
199
|
|
|
147
200
|
<div class="method_details first">
|
|
148
|
-
<
|
|
201
|
+
<h3 class="signature first" id="field-instance_method">
|
|
149
202
|
|
|
150
203
|
- (<tt>Object</tt>) <strong>field</strong>(name, type = :string, options = {})
|
|
151
204
|
|
|
152
205
|
|
|
153
206
|
|
|
154
|
-
|
|
207
|
+
|
|
208
|
+
|
|
209
|
+
</h3><div class="docstring">
|
|
155
210
|
<div class="discussion">
|
|
156
|
-
<p>Specify a field for a document. Its type determines how it is coerced when read in and out of the datastore:
|
|
211
|
+
<p>Specify a field for a document. Its type determines how it is coerced when read in and out of the datastore:
|
|
157
212
|
default is string, but you can also specify :integer, :float, :set, :array, :datetime, and :serialized.</p>
|
|
158
213
|
|
|
159
214
|
|
|
160
215
|
</div>
|
|
161
216
|
</div>
|
|
162
217
|
<div class="tags">
|
|
163
|
-
<
|
|
218
|
+
<p class="tag_title">Parameters:</p>
|
|
164
219
|
<ul class="param">
|
|
165
220
|
|
|
166
221
|
<li>
|
|
@@ -214,7 +269,7 @@ default is string, but you can also specify :integer, :float, :set, :array, :dat
|
|
|
214
269
|
|
|
215
270
|
</ul>
|
|
216
271
|
|
|
217
|
-
<
|
|
272
|
+
<p class="tag_title">Since:</p>
|
|
218
273
|
<ul class="since">
|
|
219
274
|
|
|
220
275
|
<li>
|
|
@@ -236,7 +291,6 @@ default is string, but you can also specify :integer, :float, :set, :array, :dat
|
|
|
236
291
|
<pre class="lines">
|
|
237
292
|
|
|
238
293
|
|
|
239
|
-
30
|
|
240
294
|
31
|
|
241
295
|
32
|
|
242
296
|
33
|
|
@@ -244,21 +298,18 @@ default is string, but you can also specify :integer, :float, :set, :array, :dat
|
|
|
244
298
|
35
|
|
245
299
|
36
|
|
246
300
|
37
|
|
247
|
-
38
|
|
248
|
-
39</pre>
|
|
301
|
+
38</pre>
|
|
249
302
|
</td>
|
|
250
303
|
<td>
|
|
251
|
-
<pre class="code"><span class="info file"># File 'lib/dynamoid/fields.rb', line
|
|
304
|
+
<pre class="code"><span class="info file"># File 'lib/dynamoid/fields.rb', line 31</span>
|
|
252
305
|
|
|
253
306
|
<span class='kw'>def</span> <span class='id identifier rubyid_field'>field</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='comma'>,</span> <span class='id identifier rubyid_type'>type</span> <span class='op'>=</span> <span class='symbol'>:string</span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
|
|
254
307
|
<span class='id identifier rubyid_named'>named</span> <span class='op'>=</span> <span class='id identifier rubyid_name'>name</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span>
|
|
255
|
-
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_attributes'>attributes</span
|
|
308
|
+
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_attributes'>attributes</span> <span class='op'>=</span> <span class='id identifier rubyid_attributes'>attributes</span><span class='period'>.</span><span class='id identifier rubyid_merge'>merge</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span> <span class='op'>=></span> <span class='lbrace'>{</span><span class='symbol'>:type</span> <span class='op'>=></span> <span class='id identifier rubyid_type'>type</span><span class='rbrace'>}</span><span class='period'>.</span><span class='id identifier rubyid_merge'>merge</span><span class='lparen'>(</span><span class='id identifier rubyid_options'>options</span><span class='rparen'>)</span><span class='rparen'>)</span>
|
|
256
309
|
|
|
257
310
|
<span class='id identifier rubyid_define_method'>define_method</span><span class='lparen'>(</span><span class='id identifier rubyid_named'>named</span><span class='rparen'>)</span> <span class='lbrace'>{</span> <span class='id identifier rubyid_read_attribute'>read_attribute</span><span class='lparen'>(</span><span class='id identifier rubyid_named'>named</span><span class='rparen'>)</span> <span class='rbrace'>}</span>
|
|
258
311
|
<span class='id identifier rubyid_define_method'>define_method</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_named'>named</span><span class='rbrace'>}</span><span class='tstring_content'>?</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span> <span class='lbrace'>{</span> <span class='op'>!</span><span class='id identifier rubyid_read_attribute'>read_attribute</span><span class='lparen'>(</span><span class='id identifier rubyid_named'>named</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span> <span class='rbrace'>}</span>
|
|
259
312
|
<span class='id identifier rubyid_define_method'>define_method</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_named'>named</span><span class='rbrace'>}</span><span class='tstring_content'>=</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span> <span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_value'>value</span><span class='op'>|</span> <span class='id identifier rubyid_write_attribute'>write_attribute</span><span class='lparen'>(</span><span class='id identifier rubyid_named'>named</span><span class='comma'>,</span> <span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span> <span class='rbrace'>}</span>
|
|
260
|
-
|
|
261
|
-
<span class='id identifier rubyid_respond_to?'>respond_to?</span><span class='lparen'>(</span><span class='symbol'>:define_attribute_method</span><span class='rparen'>)</span> <span class='op'>?</span> <span class='id identifier rubyid_define_attribute_method'>define_attribute_method</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='rparen'>)</span> <span class='op'>:</span> <span class='id identifier rubyid_define_attribute_methods'>define_attribute_methods</span><span class='lparen'>(</span><span class='lbracket'>[</span><span class='id identifier rubyid_name'>name</span><span class='rbracket'>]</span><span class='rparen'>)</span>
|
|
262
313
|
<span class='kw'>end</span></pre>
|
|
263
314
|
</td>
|
|
264
315
|
</tr>
|
|
@@ -266,25 +317,27 @@ default is string, but you can also specify :integer, :float, :set, :array, :dat
|
|
|
266
317
|
</div>
|
|
267
318
|
|
|
268
319
|
<div class="method_details ">
|
|
269
|
-
<
|
|
320
|
+
<h3 class="signature " id="range-instance_method">
|
|
270
321
|
|
|
271
322
|
- (<tt>Object</tt>) <strong>range</strong>(name, type = :string)
|
|
272
323
|
|
|
273
324
|
|
|
274
325
|
|
|
275
|
-
|
|
326
|
+
|
|
327
|
+
|
|
328
|
+
</h3><table class="source_code">
|
|
276
329
|
<tr>
|
|
277
330
|
<td>
|
|
278
331
|
<pre class="lines">
|
|
279
332
|
|
|
280
333
|
|
|
334
|
+
40
|
|
281
335
|
41
|
|
282
336
|
42
|
|
283
|
-
43
|
|
284
|
-
44</pre>
|
|
337
|
+
43</pre>
|
|
285
338
|
</td>
|
|
286
339
|
<td>
|
|
287
|
-
<pre class="code"><span class="info file"># File 'lib/dynamoid/fields.rb', line
|
|
340
|
+
<pre class="code"><span class="info file"># File 'lib/dynamoid/fields.rb', line 40</span>
|
|
288
341
|
|
|
289
342
|
<span class='kw'>def</span> <span class='id identifier rubyid_range'>range</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='comma'>,</span> <span class='id identifier rubyid_type'>type</span> <span class='op'>=</span> <span class='symbol'>:string</span><span class='rparen'>)</span>
|
|
290
343
|
<span class='id identifier rubyid_field'>field</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='comma'>,</span> <span class='id identifier rubyid_type'>type</span><span class='rparen'>)</span>
|
|
@@ -295,14 +348,90 @@ default is string, but you can also specify :integer, :float, :set, :array, :dat
|
|
|
295
348
|
</table>
|
|
296
349
|
</div>
|
|
297
350
|
|
|
298
|
-
|
|
351
|
+
<div class="method_details ">
|
|
352
|
+
<h3 class="signature " id="remove_field-instance_method">
|
|
353
|
+
|
|
354
|
+
- (<tt>Object</tt>) <strong>remove_field</strong>(field)
|
|
355
|
+
|
|
356
|
+
|
|
357
|
+
|
|
358
|
+
|
|
359
|
+
|
|
360
|
+
</h3><table class="source_code">
|
|
361
|
+
<tr>
|
|
362
|
+
<td>
|
|
363
|
+
<pre class="lines">
|
|
364
|
+
|
|
365
|
+
|
|
366
|
+
53
|
|
367
|
+
54
|
|
368
|
+
55
|
|
369
|
+
56
|
|
370
|
+
57
|
|
371
|
+
58
|
|
372
|
+
59</pre>
|
|
373
|
+
</td>
|
|
374
|
+
<td>
|
|
375
|
+
<pre class="code"><span class="info file"># File 'lib/dynamoid/fields.rb', line 53</span>
|
|
376
|
+
|
|
377
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_remove_field'>remove_field</span><span class='lparen'>(</span><span class='id identifier rubyid_field'>field</span><span class='rparen'>)</span>
|
|
378
|
+
<span class='id identifier rubyid_field'>field</span> <span class='op'>=</span> <span class='id identifier rubyid_field'>field</span><span class='period'>.</span><span class='id identifier rubyid_to_sym'>to_sym</span>
|
|
379
|
+
<span class='id identifier rubyid_attributes'>attributes</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='id identifier rubyid_field'>field</span><span class='rparen'>)</span> <span class='kw'>or</span> <span class='id identifier rubyid_raise'>raise</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>No such field</span><span class='tstring_end'>"</span></span>
|
|
380
|
+
<span class='id identifier rubyid_remove_method'>remove_method</span> <span class='id identifier rubyid_field'>field</span>
|
|
381
|
+
<span class='id identifier rubyid_remove_method'>remove_method</span> <span class='symbol'>:#{</span><span class='id identifier rubyid_field'>field</span><span class='rbrace'>}</span><span class='tstring_content'>=</span><span class='tstring_end'>"</span></span>
|
|
382
|
+
<span class='id identifier rubyid_remove_method'>remove_method</span> <span class='symbol'>:#{</span><span class='id identifier rubyid_field'>field</span><span class='rbrace'>}</span><span class='tstring_content'>?</span><span class='tstring_end'>"</span></span>
|
|
383
|
+
<span class='kw'>end</span></pre>
|
|
384
|
+
</td>
|
|
385
|
+
</tr>
|
|
386
|
+
</table>
|
|
387
|
+
</div>
|
|
388
|
+
|
|
389
|
+
<div class="method_details ">
|
|
390
|
+
<h3 class="signature " id="table-instance_method">
|
|
391
|
+
|
|
392
|
+
- (<tt>Object</tt>) <strong>table</strong>(options)
|
|
393
|
+
|
|
299
394
|
|
|
395
|
+
|
|
396
|
+
|
|
397
|
+
|
|
398
|
+
</h3><table class="source_code">
|
|
399
|
+
<tr>
|
|
400
|
+
<td>
|
|
401
|
+
<pre class="lines">
|
|
402
|
+
|
|
403
|
+
|
|
404
|
+
45
|
|
405
|
+
46
|
|
406
|
+
47
|
|
407
|
+
48
|
|
408
|
+
49
|
|
409
|
+
50
|
|
410
|
+
51</pre>
|
|
411
|
+
</td>
|
|
412
|
+
<td>
|
|
413
|
+
<pre class="code"><span class="info file"># File 'lib/dynamoid/fields.rb', line 45</span>
|
|
414
|
+
|
|
415
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_table'>table</span><span class='lparen'>(</span><span class='id identifier rubyid_options'>options</span><span class='rparen'>)</span>
|
|
416
|
+
<span class='comment'>#a default 'id' column is created when Dynamoid::Document is included
|
|
417
|
+
</span> <span class='kw'>unless</span><span class='lparen'>(</span><span class='id identifier rubyid_attributes'>attributes</span><span class='period'>.</span><span class='id identifier rubyid_has_key?'>has_key?</span> <span class='id identifier rubyid_hash_key'>hash_key</span><span class='rparen'>)</span>
|
|
418
|
+
<span class='id identifier rubyid_remove_field'>remove_field</span> <span class='symbol'>:id</span>
|
|
419
|
+
<span class='id identifier rubyid_field'>field</span><span class='lparen'>(</span><span class='id identifier rubyid_hash_key'>hash_key</span><span class='rparen'>)</span>
|
|
420
|
+
<span class='kw'>end</span>
|
|
421
|
+
<span class='kw'>end</span></pre>
|
|
422
|
+
</td>
|
|
423
|
+
</tr>
|
|
424
|
+
</table>
|
|
300
425
|
</div>
|
|
301
426
|
|
|
427
|
+
</div>
|
|
428
|
+
|
|
429
|
+
</div>
|
|
430
|
+
|
|
302
431
|
<div id="footer">
|
|
303
|
-
Generated on Thu
|
|
432
|
+
Generated on Thu Jun 27 21:59:09 2013 by
|
|
304
433
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
305
|
-
0.
|
|
434
|
+
0.8.6.1 (ruby-1.9.3).
|
|
306
435
|
</div>
|
|
307
436
|
|
|
308
437
|
</body>
|
data/doc/Dynamoid/Finders.html
CHANGED
|
@@ -6,19 +6,21 @@
|
|
|
6
6
|
<title>
|
|
7
7
|
Module: Dynamoid::Finders
|
|
8
8
|
|
|
9
|
-
— Documentation by YARD 0.
|
|
9
|
+
— Documentation by YARD 0.8.6.1
|
|
10
10
|
|
|
11
11
|
</title>
|
|
12
12
|
|
|
13
|
-
<link rel="stylesheet" href="../css/style.css" type="text/css"
|
|
13
|
+
<link rel="stylesheet" href="../css/style.css" type="text/css" charset="utf-8" />
|
|
14
14
|
|
|
15
|
-
<link rel="stylesheet" href="../css/common.css" type="text/css"
|
|
15
|
+
<link rel="stylesheet" href="../css/common.css" type="text/css" charset="utf-8" />
|
|
16
16
|
|
|
17
17
|
<script type="text/javascript" charset="utf-8">
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
hasFrames = window.top.frames.main ? true : false;
|
|
19
|
+
relpath = '../';
|
|
20
|
+
framesUrl = "../frames.html#!" + escape(window.location.href);
|
|
20
21
|
</script>
|
|
21
22
|
|
|
23
|
+
|
|
22
24
|
<script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
|
|
23
25
|
|
|
24
26
|
<script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
|
|
@@ -26,36 +28,41 @@
|
|
|
26
28
|
|
|
27
29
|
</head>
|
|
28
30
|
<body>
|
|
29
|
-
<script type="text/javascript" charset="utf-8">
|
|
30
|
-
if (window.top.frames.main) document.body.className = 'frames';
|
|
31
|
-
</script>
|
|
32
|
-
|
|
33
31
|
<div id="header">
|
|
34
32
|
<div id="menu">
|
|
35
33
|
|
|
36
|
-
<a href="../_index.html">Index (F)</a> »
|
|
34
|
+
<a href="../_index.html">Index (F)</a> »
|
|
37
35
|
<span class='title'><span class='object_link'><a href="../Dynamoid.html" title="Dynamoid (module)">Dynamoid</a></span></span>
|
|
38
36
|
»
|
|
39
37
|
<span class="title">Finders</span>
|
|
40
38
|
|
|
41
|
-
|
|
39
|
+
|
|
42
40
|
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
|
43
41
|
</div>
|
|
44
42
|
|
|
45
43
|
<div id="search">
|
|
46
44
|
|
|
47
|
-
<a
|
|
45
|
+
<a class="full_list_link" id="class_list_link"
|
|
46
|
+
href="../class_list.html">
|
|
47
|
+
Class List
|
|
48
|
+
</a>
|
|
48
49
|
|
|
49
|
-
<a
|
|
50
|
+
<a class="full_list_link" id="method_list_link"
|
|
51
|
+
href="../method_list.html">
|
|
52
|
+
Method List
|
|
53
|
+
</a>
|
|
50
54
|
|
|
51
|
-
<a
|
|
55
|
+
<a class="full_list_link" id="file_list_link"
|
|
56
|
+
href="../file_list.html">
|
|
57
|
+
File List
|
|
58
|
+
</a>
|
|
52
59
|
|
|
53
60
|
</div>
|
|
54
61
|
<div class="clear"></div>
|
|
55
62
|
</div>
|
|
56
|
-
|
|
63
|
+
|
|
57
64
|
<iframe id="search_frame"></iframe>
|
|
58
|
-
|
|
65
|
+
|
|
59
66
|
<div id="content"><h1>Module: Dynamoid::Finders
|
|
60
67
|
|
|
61
68
|
|
|
@@ -98,11 +105,11 @@ class level, like find, find_by_id, and the method_missing style finders.</p>
|
|
|
98
105
|
|
|
99
106
|
</div><h2>Defined Under Namespace</h2>
|
|
100
107
|
<p class="children">
|
|
101
|
-
|
|
108
|
+
|
|
102
109
|
|
|
103
110
|
<strong class="modules">Modules:</strong> <span class='object_link'><a href="Finders/ClassMethods.html" title="Dynamoid::Finders::ClassMethods (module)">ClassMethods</a></span>
|
|
104
111
|
|
|
105
|
-
|
|
112
|
+
|
|
106
113
|
|
|
107
114
|
|
|
108
115
|
</p>
|
|
@@ -117,11 +124,11 @@ class level, like find, find_by_id, and the method_missing style finders.</p>
|
|
|
117
124
|
|
|
118
125
|
|
|
119
126
|
</div>
|
|
120
|
-
|
|
127
|
+
|
|
121
128
|
<div id="footer">
|
|
122
|
-
Generated on Thu
|
|
129
|
+
Generated on Thu Jun 27 21:59:10 2013 by
|
|
123
130
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
124
|
-
0.
|
|
131
|
+
0.8.6.1 (ruby-1.9.3).
|
|
125
132
|
</div>
|
|
126
133
|
|
|
127
134
|
</body>
|
|
@@ -6,19 +6,21 @@
|
|
|
6
6
|
<title>
|
|
7
7
|
Module: Dynamoid::Finders::ClassMethods
|
|
8
8
|
|
|
9
|
-
— Documentation by YARD 0.
|
|
9
|
+
— Documentation by YARD 0.8.6.1
|
|
10
10
|
|
|
11
11
|
</title>
|
|
12
12
|
|
|
13
|
-
<link rel="stylesheet" href="../../css/style.css" type="text/css"
|
|
13
|
+
<link rel="stylesheet" href="../../css/style.css" type="text/css" charset="utf-8" />
|
|
14
14
|
|
|
15
|
-
<link rel="stylesheet" href="../../css/common.css" type="text/css"
|
|
15
|
+
<link rel="stylesheet" href="../../css/common.css" type="text/css" charset="utf-8" />
|
|
16
16
|
|
|
17
17
|
<script type="text/javascript" charset="utf-8">
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
hasFrames = window.top.frames.main ? true : false;
|
|
19
|
+
relpath = '../../';
|
|
20
|
+
framesUrl = "../../frames.html#!" + escape(window.location.href);
|
|
20
21
|
</script>
|
|
21
22
|
|
|
23
|
+
|
|
22
24
|
<script type="text/javascript" charset="utf-8" src="../../js/jquery.js"></script>
|
|
23
25
|
|
|
24
26
|
<script type="text/javascript" charset="utf-8" src="../../js/app.js"></script>
|
|
@@ -26,36 +28,41 @@
|
|
|
26
28
|
|
|
27
29
|
</head>
|
|
28
30
|
<body>
|
|
29
|
-
<script type="text/javascript" charset="utf-8">
|
|
30
|
-
if (window.top.frames.main) document.body.className = 'frames';
|
|
31
|
-
</script>
|
|
32
|
-
|
|
33
31
|
<div id="header">
|
|
34
32
|
<div id="menu">
|
|
35
33
|
|
|
36
|
-
<a href="../../_index.html">Index (C)</a> »
|
|
34
|
+
<a href="../../_index.html">Index (C)</a> »
|
|
37
35
|
<span class='title'><span class='object_link'><a href="../../Dynamoid.html" title="Dynamoid (module)">Dynamoid</a></span></span> » <span class='title'><span class='object_link'><a href="../Finders.html" title="Dynamoid::Finders (module)">Finders</a></span></span>
|
|
38
36
|
»
|
|
39
37
|
<span class="title">ClassMethods</span>
|
|
40
38
|
|
|
41
|
-
|
|
39
|
+
|
|
42
40
|
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
|
43
41
|
</div>
|
|
44
42
|
|
|
45
43
|
<div id="search">
|
|
46
44
|
|
|
47
|
-
<a
|
|
45
|
+
<a class="full_list_link" id="class_list_link"
|
|
46
|
+
href="../../class_list.html">
|
|
47
|
+
Class List
|
|
48
|
+
</a>
|
|
48
49
|
|
|
49
|
-
<a
|
|
50
|
+
<a class="full_list_link" id="method_list_link"
|
|
51
|
+
href="../../method_list.html">
|
|
52
|
+
Method List
|
|
53
|
+
</a>
|
|
50
54
|
|
|
51
|
-
<a
|
|
55
|
+
<a class="full_list_link" id="file_list_link"
|
|
56
|
+
href="../../file_list.html">
|
|
57
|
+
File List
|
|
58
|
+
</a>
|
|
52
59
|
|
|
53
60
|
</div>
|
|
54
61
|
<div class="clear"></div>
|
|
55
62
|
</div>
|
|
56
|
-
|
|
63
|
+
|
|
57
64
|
<iframe id="search_frame"></iframe>
|
|
58
|
-
|
|
65
|
+
|
|
59
66
|
<div id="content"><h1>Module: Dynamoid::Finders::ClassMethods
|
|
60
67
|
|
|
61
68
|
|
|
@@ -106,11 +113,81 @@
|
|
|
106
113
|
|
|
107
114
|
|
|
108
115
|
|
|
116
|
+
|
|
109
117
|
|
|
110
118
|
|
|
111
119
|
<span class="summary_desc"><div class='inline'><p>Find one or many objects, specified by one id or an array of ids.</p>
|
|
112
120
|
</div></span>
|
|
113
121
|
|
|
122
|
+
</li>
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
<li class="public ">
|
|
126
|
+
<span class="summary_signature">
|
|
127
|
+
|
|
128
|
+
<a href="#find_all-instance_method" title="#find_all (instance method)">- (Object) <strong>find_all</strong>(ids, options = {}) </a>
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
</span>
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
<span class="summary_desc"><div class='inline'><p>Return objects found by the given array of ids, either hash keys, or hash/range key combinations using BatchGet.</p>
|
|
143
|
+
</div></span>
|
|
144
|
+
|
|
145
|
+
</li>
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+
<li class="public ">
|
|
149
|
+
<span class="summary_signature">
|
|
150
|
+
|
|
151
|
+
<a href="#find_all_by_composite_key-instance_method" title="#find_all_by_composite_key (instance method)">- (Array) <strong>find_all_by_composite_key</strong>(hash_key, options = {}) </a>
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
|
|
155
|
+
</span>
|
|
156
|
+
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
|
|
160
|
+
|
|
161
|
+
|
|
162
|
+
|
|
163
|
+
|
|
164
|
+
|
|
165
|
+
<span class="summary_desc"><div class='inline'><p>Find all objects by hash and range keys.</p>
|
|
166
|
+
</div></span>
|
|
167
|
+
|
|
168
|
+
</li>
|
|
169
|
+
|
|
170
|
+
|
|
171
|
+
<li class="public ">
|
|
172
|
+
<span class="summary_signature">
|
|
173
|
+
|
|
174
|
+
<a href="#find_by_composite_key-instance_method" title="#find_by_composite_key (instance method)">- (Object) <strong>find_by_composite_key</strong>(hash_key, range_key, options = {}) </a>
|
|
175
|
+
|
|
176
|
+
|
|
177
|
+
|
|
178
|
+
</span>
|
|
179
|
+
|
|
180
|
+
|
|
181
|
+
|
|
182
|
+
|
|
183
|
+
|
|
184
|
+
|
|
185
|
+
|
|
186
|
+
|
|
187
|
+
|
|
188
|
+
<span class="summary_desc"><div class='inline'><p>Find one object directly by hash and range keys.</p>
|
|
189
|
+
</div></span>
|
|
190
|
+
|
|
114
191
|
</li>
|
|
115
192
|
|
|
116
193
|
|
|
@@ -128,6 +205,7 @@
|
|
|
128
205
|
|
|
129
206
|
|
|
130
207
|
|
|
208
|
+
|
|
131
209
|
|
|
132
210
|
|
|
133
211
|
<span class="summary_desc"><div class='inline'><p>Find one object directly by id.</p>
|
|
@@ -150,6 +228,7 @@
|
|
|
150
228
|
|
|
151
229
|
|
|
152
230
|
|
|
231
|
+
|
|
153
232
|
|
|
154
233
|
|
|
155
234
|
<span class="summary_desc"><div class='inline'><p>Find using exciting method_missing finders attributes.</p>
|
|
@@ -169,13 +248,15 @@
|
|
|
169
248
|
</p>
|
|
170
249
|
|
|
171
250
|
<div class="method_details first">
|
|
172
|
-
<
|
|
251
|
+
<h3 class="signature first" id="method_missing-instance_method">
|
|
173
252
|
|
|
174
253
|
- (<tt><span class='object_link'><a href="../Document.html" title="Dynamoid::Document (module)">Dynamoid::Document</a></span>/Array</tt>) <strong>method_missing</strong>(method, *args)
|
|
175
254
|
|
|
176
255
|
|
|
177
256
|
|
|
178
|
-
|
|
257
|
+
|
|
258
|
+
|
|
259
|
+
</h3><div class="docstring">
|
|
179
260
|
<div class="discussion">
|
|
180
261
|
<p>Find using exciting method_missing finders attributes. Uses criteria chains under the hood to accomplish this neatness.</p>
|
|
181
262
|
|
|
@@ -185,19 +266,23 @@
|
|
|
185
266
|
<div class="tags">
|
|
186
267
|
|
|
187
268
|
<div class="examples">
|
|
188
|
-
<
|
|
269
|
+
<p class="tag_title">Examples:</p>
|
|
189
270
|
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
271
|
+
|
|
272
|
+
<p class="example_title"><div class='inline'><p>find a user by a first name</p>
|
|
273
|
+
</div></p>
|
|
274
|
+
|
|
275
|
+
<pre class="example code"><code><span class='const'>User</span><span class='period'>.</span><span class='id identifier rubyid_find_by_first_name'>find_by_first_name</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Josh</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span></code></pre>
|
|
193
276
|
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
277
|
+
|
|
278
|
+
<p class="example_title"><div class='inline'><p>find all users by first and last name</p>
|
|
279
|
+
</div></p>
|
|
280
|
+
|
|
281
|
+
<pre class="example code"><code><span class='const'>User</span><span class='period'>.</span><span class='id identifier rubyid_find_all_by_first_name_and_last_name'>find_all_by_first_name_and_last_name</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Josh</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Symonds</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span></code></pre>
|
|
197
282
|
|
|
198
283
|
</div>
|
|
199
284
|
|
|
200
|
-
<
|
|
285
|
+
<p class="tag_title">Returns:</p>
|
|
201
286
|
<ul class="return">
|
|
202
287
|
|
|
203
288
|
<li>
|
|
@@ -214,7 +299,7 @@
|
|
|
214
299
|
</li>
|
|
215
300
|
|
|
216
301
|
</ul>
|
|
217
|
-
<
|
|
302
|
+
<p class="tag_title">Since:</p>
|
|
218
303
|
<ul class="since">
|
|
219
304
|
|
|
220
305
|
<li>
|
|
@@ -236,26 +321,26 @@
|
|
|
236
321
|
<pre class="lines">
|
|
237
322
|
|
|
238
323
|
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
324
|
+
113
|
|
325
|
+
114
|
|
326
|
+
115
|
|
327
|
+
116
|
|
328
|
+
117
|
|
329
|
+
118
|
|
330
|
+
119
|
|
331
|
+
120
|
|
332
|
+
121
|
|
333
|
+
122
|
|
334
|
+
123
|
|
335
|
+
124
|
|
336
|
+
125
|
|
337
|
+
126
|
|
338
|
+
127
|
|
339
|
+
128
|
|
340
|
+
129</pre>
|
|
256
341
|
</td>
|
|
257
342
|
<td>
|
|
258
|
-
<pre class="code"><span class="info file"># File 'lib/dynamoid/finders.rb', line
|
|
343
|
+
<pre class="code"><span class="info file"># File 'lib/dynamoid/finders.rb', line 113</span>
|
|
259
344
|
|
|
260
345
|
<span class='kw'>def</span> <span class='id identifier rubyid_method_missing'>method_missing</span><span class='lparen'>(</span><span class='id identifier rubyid_method'>method</span><span class='comma'>,</span> <span class='op'>*</span><span class='id identifier rubyid_args'>args</span><span class='rparen'>)</span>
|
|
261
346
|
<span class='kw'>if</span> <span class='id identifier rubyid_method'>method</span> <span class='op'>=~</span> <span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>find</span><span class='regexp_end'>/</span></span>
|
|
@@ -264,7 +349,7 @@
|
|
|
264
349
|
|
|
265
350
|
<span class='id identifier rubyid_chain'>chain</span> <span class='op'>=</span> <span class='const'>Dynamoid</span><span class='op'>::</span><span class='const'>Criteria</span><span class='op'>::</span><span class='const'>Chain</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='kw'>self</span><span class='rparen'>)</span>
|
|
266
351
|
<span class='id identifier rubyid_chain'>chain</span><span class='period'>.</span><span class='id identifier rubyid_query'>query</span> <span class='op'>=</span> <span class='const'>Hash</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='period'>.</span><span class='id identifier rubyid_tap'>tap</span> <span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_h'>h</span><span class='op'>|</span> <span class='id identifier rubyid_attributes'>attributes</span><span class='period'>.</span><span class='id identifier rubyid_each_with_index'>each_with_index</span> <span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_attr'>attr</span><span class='comma'>,</span> <span class='id identifier rubyid_index'>index</span><span class='op'>|</span> <span class='id identifier rubyid_h'>h</span><span class='lbracket'>[</span><span class='id identifier rubyid_attr'>attr</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_args'>args</span><span class='lbracket'>[</span><span class='id identifier rubyid_index'>index</span><span class='rbracket'>]</span><span class='rbrace'>}</span><span class='rbrace'>}</span>
|
|
267
|
-
|
|
352
|
+
|
|
268
353
|
<span class='kw'>if</span> <span class='id identifier rubyid_finder'>finder</span> <span class='op'>=~</span> <span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>all</span><span class='regexp_end'>/</span></span>
|
|
269
354
|
<span class='kw'>return</span> <span class='id identifier rubyid_chain'>chain</span><span class='period'>.</span><span class='id identifier rubyid_all'>all</span>
|
|
270
355
|
<span class='kw'>else</span>
|
|
@@ -284,16 +369,18 @@
|
|
|
284
369
|
|
|
285
370
|
<div id="instance_method_details" class="method_details_list">
|
|
286
371
|
<h2>Instance Method Details</h2>
|
|
287
|
-
|
|
372
|
+
|
|
288
373
|
|
|
289
374
|
<div class="method_details first">
|
|
290
|
-
<
|
|
375
|
+
<h3 class="signature first" id="find-instance_method">
|
|
291
376
|
|
|
292
377
|
- (<tt><span class='object_link'><a href="../Document.html" title="Dynamoid::Document (module)">Dynamoid::Document</a></span></tt>) <strong>find</strong>(*ids)
|
|
293
378
|
|
|
294
379
|
|
|
295
380
|
|
|
296
|
-
|
|
381
|
+
|
|
382
|
+
|
|
383
|
+
</h3><div class="docstring">
|
|
297
384
|
<div class="discussion">
|
|
298
385
|
<p>Find one or many objects, specified by one id or an array of ids.</p>
|
|
299
386
|
|
|
@@ -301,7 +388,7 @@
|
|
|
301
388
|
</div>
|
|
302
389
|
</div>
|
|
303
390
|
<div class="tags">
|
|
304
|
-
<
|
|
391
|
+
<p class="tag_title">Parameters:</p>
|
|
305
392
|
<ul class="param">
|
|
306
393
|
|
|
307
394
|
<li>
|
|
@@ -321,7 +408,7 @@
|
|
|
321
408
|
|
|
322
409
|
</ul>
|
|
323
410
|
|
|
324
|
-
<
|
|
411
|
+
<p class="tag_title">Returns:</p>
|
|
325
412
|
<ul class="return">
|
|
326
413
|
|
|
327
414
|
<li>
|
|
@@ -338,7 +425,7 @@
|
|
|
338
425
|
</li>
|
|
339
426
|
|
|
340
427
|
</ul>
|
|
341
|
-
<
|
|
428
|
+
<p class="tag_title">Since:</p>
|
|
342
429
|
<ul class="since">
|
|
343
430
|
|
|
344
431
|
<li>
|
|
@@ -374,8 +461,7 @@
|
|
|
374
461
|
29
|
|
375
462
|
30
|
|
376
463
|
31
|
|
377
|
-
32
|
|
378
|
-
33</pre>
|
|
464
|
+
32</pre>
|
|
379
465
|
</td>
|
|
380
466
|
<td>
|
|
381
467
|
<pre class="code"><span class="info file"># File 'lib/dynamoid/finders.rb', line 18</span>
|
|
@@ -392,8 +478,277 @@
|
|
|
392
478
|
<span class='kw'>if</span> <span class='id identifier rubyid_ids'>ids</span><span class='period'>.</span><span class='id identifier rubyid_count'>count</span> <span class='op'>==</span> <span class='int'>1</span>
|
|
393
479
|
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_find_by_id'>find_by_id</span><span class='lparen'>(</span><span class='id identifier rubyid_ids'>ids</span><span class='period'>.</span><span class='id identifier rubyid_first'>first</span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span><span class='rparen'>)</span>
|
|
394
480
|
<span class='kw'>else</span>
|
|
395
|
-
<span class='id identifier
|
|
396
|
-
|
|
481
|
+
<span class='id identifier rubyid_find_all'>find_all</span><span class='lparen'>(</span><span class='id identifier rubyid_ids'>ids</span><span class='rparen'>)</span>
|
|
482
|
+
<span class='kw'>end</span>
|
|
483
|
+
<span class='kw'>end</span></pre>
|
|
484
|
+
</td>
|
|
485
|
+
</tr>
|
|
486
|
+
</table>
|
|
487
|
+
</div>
|
|
488
|
+
|
|
489
|
+
<div class="method_details ">
|
|
490
|
+
<h3 class="signature " id="find_all-instance_method">
|
|
491
|
+
|
|
492
|
+
- (<tt>Object</tt>) <strong>find_all</strong>(ids, options = {})
|
|
493
|
+
|
|
494
|
+
|
|
495
|
+
|
|
496
|
+
|
|
497
|
+
|
|
498
|
+
</h3><div class="docstring">
|
|
499
|
+
<div class="discussion">
|
|
500
|
+
<p>Return objects found by the given array of ids, either hash keys, or hash/range key combinations using BatchGet.
|
|
501
|
+
Returns empty array if no results found.</p>
|
|
502
|
+
|
|
503
|
+
|
|
504
|
+
</div>
|
|
505
|
+
</div>
|
|
506
|
+
<div class="tags">
|
|
507
|
+
|
|
508
|
+
<div class="examples">
|
|
509
|
+
<p class="tag_title">Examples:</p>
|
|
510
|
+
|
|
511
|
+
|
|
512
|
+
<pre class="example code"><code><span class='id identifier rubyid_find'>find</span> <span class='id identifier rubyid_all'>all</span> <span class='id identifier rubyid_the'>the</span> <span class='id identifier rubyid_user'>user</span> <span class='id identifier rubyid_with'>with</span> <span class='id identifier rubyid_hash'>hash</span> <span class='id identifier rubyid_key'>key</span>
|
|
513
|
+
<span class='const'>User</span><span class='period'>.</span><span class='id identifier rubyid_find_all'>find_all</span><span class='lparen'>(</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>1</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>2</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>3</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span><span class='rparen'>)</span>
|
|
514
|
+
|
|
515
|
+
<span class='id identifier rubyid_find'>find</span> <span class='id identifier rubyid_all'>all</span> <span class='id identifier rubyid_the'>the</span> <span class='id identifier rubyid_tweets'>tweets</span> <span class='id identifier rubyid_using'>using</span> <span class='id identifier rubyid_hash'>hash</span> <span class='id identifier rubyid_key'>key</span> <span class='kw'>and</span> <span class='id identifier rubyid_range'>range</span> <span class='id identifier rubyid_key'>key</span> <span class='id identifier rubyid_with'>with</span> <span class='id identifier rubyid_consistent'>consistent</span> <span class='id identifier rubyid_read'>read</span>
|
|
516
|
+
<span class='const'>Tweet</span><span class='period'>.</span><span class='id identifier rubyid_find_all'>find_all</span><span class='lparen'>(</span><span class='lbracket'>[</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>1</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>red</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>1</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>green</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='symbol'>:consistent_read</span> <span class='op'>=></span> <span class='kw'>true</span><span class='rparen'>)</span></code></pre>
|
|
517
|
+
|
|
518
|
+
</div>
|
|
519
|
+
<p class="tag_title">Parameters:</p>
|
|
520
|
+
<ul class="param">
|
|
521
|
+
|
|
522
|
+
<li>
|
|
523
|
+
|
|
524
|
+
<span class='name'>ids</span>
|
|
525
|
+
|
|
526
|
+
|
|
527
|
+
<span class='type'>(<tt>Array<ID></tt>)</span>
|
|
528
|
+
|
|
529
|
+
|
|
530
|
+
|
|
531
|
+
</li>
|
|
532
|
+
|
|
533
|
+
<li>
|
|
534
|
+
|
|
535
|
+
<span class='name'>options:</span>
|
|
536
|
+
|
|
537
|
+
|
|
538
|
+
<span class='type'>(<tt>Hash</tt>)</span>
|
|
539
|
+
|
|
540
|
+
|
|
541
|
+
|
|
542
|
+
—
|
|
543
|
+
<div class='inline'><p>Passed to the underlying query.</p>
|
|
544
|
+
</div>
|
|
545
|
+
|
|
546
|
+
</li>
|
|
547
|
+
|
|
548
|
+
</ul>
|
|
549
|
+
|
|
550
|
+
|
|
551
|
+
</div><table class="source_code">
|
|
552
|
+
<tr>
|
|
553
|
+
<td>
|
|
554
|
+
<pre class="lines">
|
|
555
|
+
|
|
556
|
+
|
|
557
|
+
46
|
|
558
|
+
47
|
|
559
|
+
48
|
|
560
|
+
49</pre>
|
|
561
|
+
</td>
|
|
562
|
+
<td>
|
|
563
|
+
<pre class="code"><span class="info file"># File 'lib/dynamoid/finders.rb', line 46</span>
|
|
564
|
+
|
|
565
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_find_all'>find_all</span><span class='lparen'>(</span><span class='id identifier rubyid_ids'>ids</span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
|
|
566
|
+
<span class='id identifier rubyid_items'>items</span> <span class='op'>=</span> <span class='const'>Dynamoid</span><span class='op'>::</span><span class='const'>Adapter</span><span class='period'>.</span><span class='id identifier rubyid_read'>read</span><span class='lparen'>(</span><span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_table_name'>table_name</span><span class='comma'>,</span> <span class='id identifier rubyid_ids'>ids</span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span><span class='rparen'>)</span>
|
|
567
|
+
<span class='id identifier rubyid_items'>items</span> <span class='op'>?</span> <span class='id identifier rubyid_items'>items</span><span class='lbracket'>[</span><span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_table_name'>table_name</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_map'>map</span><span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_i'>i</span><span class='op'>|</span> <span class='id identifier rubyid_from_database'>from_database</span><span class='lparen'>(</span><span class='id identifier rubyid_i'>i</span><span class='rparen'>)</span><span class='rbrace'>}</span> <span class='op'>:</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
|
|
568
|
+
<span class='kw'>end</span></pre>
|
|
569
|
+
</td>
|
|
570
|
+
</tr>
|
|
571
|
+
</table>
|
|
572
|
+
</div>
|
|
573
|
+
|
|
574
|
+
<div class="method_details ">
|
|
575
|
+
<h3 class="signature " id="find_all_by_composite_key-instance_method">
|
|
576
|
+
|
|
577
|
+
- (<tt>Array</tt>) <strong>find_all_by_composite_key</strong>(hash_key, options = {})
|
|
578
|
+
|
|
579
|
+
|
|
580
|
+
|
|
581
|
+
|
|
582
|
+
|
|
583
|
+
</h3><div class="docstring">
|
|
584
|
+
<div class="discussion">
|
|
585
|
+
<p>Find all objects by hash and range keys.</p>
|
|
586
|
+
|
|
587
|
+
|
|
588
|
+
</div>
|
|
589
|
+
</div>
|
|
590
|
+
<div class="tags">
|
|
591
|
+
|
|
592
|
+
<div class="examples">
|
|
593
|
+
<p class="tag_title">Examples:</p>
|
|
594
|
+
|
|
595
|
+
|
|
596
|
+
<p class="example_title"><div class='inline'><p>find all ChamberTypes whose level is greater than 1</p>
|
|
597
|
+
</div></p>
|
|
598
|
+
|
|
599
|
+
<pre class="example code"><code><span class='kw'>class</span> <span class='const'>ChamberType</span>
|
|
600
|
+
<span class='id identifier rubyid_include'>include</span> <span class='const'>Dynamoid</span><span class='op'>::</span><span class='const'>Document</span>
|
|
601
|
+
<span class='id identifier rubyid_field'>field</span> <span class='symbol'>:chamber_type</span><span class='comma'>,</span> <span class='symbol'>:string</span>
|
|
602
|
+
<span class='id identifier rubyid_range'>range</span> <span class='symbol'>:level</span><span class='comma'>,</span> <span class='symbol'>:integer</span>
|
|
603
|
+
<span class='id identifier rubyid_table'>table</span> <span class='symbol'>:key</span> <span class='op'>=></span> <span class='symbol'>:chamber_type</span>
|
|
604
|
+
<span class='kw'>end</span>
|
|
605
|
+
<span class='const'>ChamberType</span><span class='period'>.</span><span class='id identifier rubyid_find_all_by_composite_key'>find_all_by_composite_key</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>DustVault</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='label'>range_greater_than:</span> <span class='int'>1</span><span class='rparen'>)</span></code></pre>
|
|
606
|
+
|
|
607
|
+
</div>
|
|
608
|
+
<p class="tag_title">Parameters:</p>
|
|
609
|
+
<ul class="param">
|
|
610
|
+
|
|
611
|
+
<li>
|
|
612
|
+
|
|
613
|
+
<span class='name'>hash_key</span>
|
|
614
|
+
|
|
615
|
+
|
|
616
|
+
<span class='type'>(<tt>String</tt>)</span>
|
|
617
|
+
|
|
618
|
+
|
|
619
|
+
|
|
620
|
+
—
|
|
621
|
+
<div class='inline'><p>of the objects to find</p>
|
|
622
|
+
</div>
|
|
623
|
+
|
|
624
|
+
</li>
|
|
625
|
+
|
|
626
|
+
<li>
|
|
627
|
+
|
|
628
|
+
<span class='name'>options</span>
|
|
629
|
+
|
|
630
|
+
|
|
631
|
+
<span class='type'>(<tt>Hash</tt>)</span>
|
|
632
|
+
|
|
633
|
+
|
|
634
|
+
<em class="default">(defaults to: <tt>{}</tt>)</em>
|
|
635
|
+
|
|
636
|
+
|
|
637
|
+
—
|
|
638
|
+
<div class='inline'><p>the options for the range key</p>
|
|
639
|
+
</div>
|
|
640
|
+
|
|
641
|
+
</li>
|
|
642
|
+
|
|
643
|
+
</ul>
|
|
644
|
+
|
|
645
|
+
|
|
646
|
+
|
|
647
|
+
|
|
648
|
+
|
|
649
|
+
|
|
650
|
+
<p class="tag_title">Options Hash (<tt>options</tt>):</p>
|
|
651
|
+
<ul class="option">
|
|
652
|
+
|
|
653
|
+
<li>
|
|
654
|
+
<span class="name">:range_value</span>
|
|
655
|
+
<span class="type">(<tt>Range</tt>)</span>
|
|
656
|
+
<span class="default">
|
|
657
|
+
|
|
658
|
+
</span>
|
|
659
|
+
|
|
660
|
+
— <div class='inline'><p>find the range key within this range</p>
|
|
661
|
+
</div>
|
|
662
|
+
|
|
663
|
+
</li>
|
|
664
|
+
|
|
665
|
+
<li>
|
|
666
|
+
<span class="name">:range_greater_than</span>
|
|
667
|
+
<span class="type">(<tt>Number</tt>)</span>
|
|
668
|
+
<span class="default">
|
|
669
|
+
|
|
670
|
+
</span>
|
|
671
|
+
|
|
672
|
+
— <div class='inline'><p>find range keys greater than this</p>
|
|
673
|
+
</div>
|
|
674
|
+
|
|
675
|
+
</li>
|
|
676
|
+
|
|
677
|
+
<li>
|
|
678
|
+
<span class="name">:range_less_than</span>
|
|
679
|
+
<span class="type">(<tt>Number</tt>)</span>
|
|
680
|
+
<span class="default">
|
|
681
|
+
|
|
682
|
+
</span>
|
|
683
|
+
|
|
684
|
+
— <div class='inline'><p>find range keys less than this</p>
|
|
685
|
+
</div>
|
|
686
|
+
|
|
687
|
+
</li>
|
|
688
|
+
|
|
689
|
+
<li>
|
|
690
|
+
<span class="name">:range_gte</span>
|
|
691
|
+
<span class="type">(<tt>Number</tt>)</span>
|
|
692
|
+
<span class="default">
|
|
693
|
+
|
|
694
|
+
</span>
|
|
695
|
+
|
|
696
|
+
— <div class='inline'><p>find range keys greater than or equal to this</p>
|
|
697
|
+
</div>
|
|
698
|
+
|
|
699
|
+
</li>
|
|
700
|
+
|
|
701
|
+
<li>
|
|
702
|
+
<span class="name">:range_lte</span>
|
|
703
|
+
<span class="type">(<tt>Number</tt>)</span>
|
|
704
|
+
<span class="default">
|
|
705
|
+
|
|
706
|
+
</span>
|
|
707
|
+
|
|
708
|
+
— <div class='inline'><p>find range keys less than or equal to this</p>
|
|
709
|
+
</div>
|
|
710
|
+
|
|
711
|
+
</li>
|
|
712
|
+
|
|
713
|
+
</ul>
|
|
714
|
+
|
|
715
|
+
|
|
716
|
+
<p class="tag_title">Returns:</p>
|
|
717
|
+
<ul class="return">
|
|
718
|
+
|
|
719
|
+
<li>
|
|
720
|
+
|
|
721
|
+
|
|
722
|
+
<span class='type'>(<tt>Array</tt>)</span>
|
|
723
|
+
|
|
724
|
+
|
|
725
|
+
|
|
726
|
+
—
|
|
727
|
+
<div class='inline'><p>an array of all matching items</p>
|
|
728
|
+
</div>
|
|
729
|
+
|
|
730
|
+
</li>
|
|
731
|
+
|
|
732
|
+
</ul>
|
|
733
|
+
|
|
734
|
+
</div><table class="source_code">
|
|
735
|
+
<tr>
|
|
736
|
+
<td>
|
|
737
|
+
<pre class="lines">
|
|
738
|
+
|
|
739
|
+
|
|
740
|
+
96
|
|
741
|
+
97
|
|
742
|
+
98
|
|
743
|
+
99
|
|
744
|
+
100</pre>
|
|
745
|
+
</td>
|
|
746
|
+
<td>
|
|
747
|
+
<pre class="code"><span class="info file"># File 'lib/dynamoid/finders.rb', line 96</span>
|
|
748
|
+
|
|
749
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_find_all_by_composite_key'>find_all_by_composite_key</span><span class='lparen'>(</span><span class='id identifier rubyid_hash_key'>hash_key</span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
|
|
750
|
+
<span class='const'>Dynamoid</span><span class='op'>::</span><span class='const'>Adapter</span><span class='period'>.</span><span class='id identifier rubyid_query'>query</span><span class='lparen'>(</span><span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_table_name'>table_name</span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span><span class='period'>.</span><span class='id identifier rubyid_merge'>merge</span><span class='lparen'>(</span><span class='lbrace'>{</span><span class='label'>hash_value:</span> <span class='id identifier rubyid_hash_key'>hash_key</span><span class='rbrace'>}</span><span class='rparen'>)</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_collect'>collect</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_item'>item</span><span class='op'>|</span>
|
|
751
|
+
<span class='id identifier rubyid_from_database'>from_database</span><span class='lparen'>(</span><span class='id identifier rubyid_item'>item</span><span class='rparen'>)</span>
|
|
397
752
|
<span class='kw'>end</span>
|
|
398
753
|
<span class='kw'>end</span></pre>
|
|
399
754
|
</td>
|
|
@@ -402,13 +757,89 @@
|
|
|
402
757
|
</div>
|
|
403
758
|
|
|
404
759
|
<div class="method_details ">
|
|
405
|
-
<
|
|
760
|
+
<h3 class="signature " id="find_by_composite_key-instance_method">
|
|
761
|
+
|
|
762
|
+
- (<tt>Object</tt>) <strong>find_by_composite_key</strong>(hash_key, range_key, options = {})
|
|
763
|
+
|
|
764
|
+
|
|
765
|
+
|
|
766
|
+
|
|
767
|
+
|
|
768
|
+
</h3><div class="docstring">
|
|
769
|
+
<div class="discussion">
|
|
770
|
+
<p>Find one object directly by hash and range keys</p>
|
|
771
|
+
|
|
772
|
+
|
|
773
|
+
</div>
|
|
774
|
+
</div>
|
|
775
|
+
<div class="tags">
|
|
776
|
+
<p class="tag_title">Parameters:</p>
|
|
777
|
+
<ul class="param">
|
|
778
|
+
|
|
779
|
+
<li>
|
|
780
|
+
|
|
781
|
+
<span class='name'>hash_key</span>
|
|
782
|
+
|
|
783
|
+
|
|
784
|
+
<span class='type'>(<tt>String</tt>)</span>
|
|
785
|
+
|
|
786
|
+
|
|
787
|
+
|
|
788
|
+
—
|
|
789
|
+
<div class='inline'><p>of the object to find</p>
|
|
790
|
+
</div>
|
|
791
|
+
|
|
792
|
+
</li>
|
|
793
|
+
|
|
794
|
+
<li>
|
|
795
|
+
|
|
796
|
+
<span class='name'>range_key</span>
|
|
797
|
+
|
|
798
|
+
|
|
799
|
+
<span class='type'>(<tt>String/Integer/Float</tt>)</span>
|
|
800
|
+
|
|
801
|
+
|
|
802
|
+
|
|
803
|
+
—
|
|
804
|
+
<div class='inline'><p>of the object to find</p>
|
|
805
|
+
</div>
|
|
806
|
+
|
|
807
|
+
</li>
|
|
808
|
+
|
|
809
|
+
</ul>
|
|
810
|
+
|
|
811
|
+
|
|
812
|
+
</div><table class="source_code">
|
|
813
|
+
<tr>
|
|
814
|
+
<td>
|
|
815
|
+
<pre class="lines">
|
|
816
|
+
|
|
817
|
+
|
|
818
|
+
71
|
|
819
|
+
72
|
|
820
|
+
73</pre>
|
|
821
|
+
</td>
|
|
822
|
+
<td>
|
|
823
|
+
<pre class="code"><span class="info file"># File 'lib/dynamoid/finders.rb', line 71</span>
|
|
824
|
+
|
|
825
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_find_by_composite_key'>find_by_composite_key</span><span class='lparen'>(</span><span class='id identifier rubyid_hash_key'>hash_key</span><span class='comma'>,</span> <span class='id identifier rubyid_range_key'>range_key</span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
|
|
826
|
+
<span class='id identifier rubyid_find_by_id'>find_by_id</span><span class='lparen'>(</span><span class='id identifier rubyid_hash_key'>hash_key</span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span><span class='period'>.</span><span class='id identifier rubyid_merge'>merge</span><span class='lparen'>(</span><span class='lbrace'>{</span><span class='symbol'>:range_key</span> <span class='op'>=></span> <span class='id identifier rubyid_range_key'>range_key</span><span class='rbrace'>}</span><span class='rparen'>)</span><span class='rparen'>)</span>
|
|
827
|
+
<span class='kw'>end</span></pre>
|
|
828
|
+
</td>
|
|
829
|
+
</tr>
|
|
830
|
+
</table>
|
|
831
|
+
</div>
|
|
832
|
+
|
|
833
|
+
<div class="method_details ">
|
|
834
|
+
<h3 class="signature " id="find_by_id-instance_method">
|
|
406
835
|
|
|
407
836
|
- (<tt><span class='object_link'><a href="../Document.html" title="Dynamoid::Document (module)">Dynamoid::Document</a></span></tt>) <strong>find_by_id</strong>(id, options = {})
|
|
408
837
|
|
|
409
838
|
|
|
410
839
|
|
|
411
|
-
|
|
840
|
+
|
|
841
|
+
|
|
842
|
+
</h3><div class="docstring">
|
|
412
843
|
<div class="discussion">
|
|
413
844
|
<p>Find one object directly by id.</p>
|
|
414
845
|
|
|
@@ -416,7 +847,7 @@
|
|
|
416
847
|
</div>
|
|
417
848
|
</div>
|
|
418
849
|
<div class="tags">
|
|
419
|
-
<
|
|
850
|
+
<p class="tag_title">Parameters:</p>
|
|
420
851
|
<ul class="param">
|
|
421
852
|
|
|
422
853
|
<li>
|
|
@@ -436,7 +867,7 @@
|
|
|
436
867
|
|
|
437
868
|
</ul>
|
|
438
869
|
|
|
439
|
-
<
|
|
870
|
+
<p class="tag_title">Returns:</p>
|
|
440
871
|
<ul class="return">
|
|
441
872
|
|
|
442
873
|
<li>
|
|
@@ -453,7 +884,7 @@
|
|
|
453
884
|
</li>
|
|
454
885
|
|
|
455
886
|
</ul>
|
|
456
|
-
<
|
|
887
|
+
<p class="tag_title">Since:</p>
|
|
457
888
|
<ul class="since">
|
|
458
889
|
|
|
459
890
|
<li>
|
|
@@ -475,26 +906,22 @@
|
|
|
475
906
|
<pre class="lines">
|
|
476
907
|
|
|
477
908
|
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
49
|
|
486
|
-
50</pre>
|
|
909
|
+
58
|
|
910
|
+
59
|
|
911
|
+
60
|
|
912
|
+
61
|
|
913
|
+
62
|
|
914
|
+
63
|
|
915
|
+
64</pre>
|
|
487
916
|
</td>
|
|
488
917
|
<td>
|
|
489
|
-
<pre class="code"><span class="info file"># File 'lib/dynamoid/finders.rb', line
|
|
918
|
+
<pre class="code"><span class="info file"># File 'lib/dynamoid/finders.rb', line 58</span>
|
|
490
919
|
|
|
491
920
|
<span class='kw'>def</span> <span class='id identifier rubyid_find_by_id'>find_by_id</span><span class='lparen'>(</span><span class='id identifier rubyid_id'>id</span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
|
|
492
921
|
<span class='kw'>if</span> <span class='id identifier rubyid_item'>item</span> <span class='op'>=</span> <span class='const'>Dynamoid</span><span class='op'>::</span><span class='const'>Adapter</span><span class='period'>.</span><span class='id identifier rubyid_read'>read</span><span class='lparen'>(</span><span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_table_name'>table_name</span><span class='comma'>,</span> <span class='id identifier rubyid_id'>id</span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span><span class='rparen'>)</span>
|
|
493
|
-
<span class='id identifier
|
|
494
|
-
<span class='id identifier rubyid_obj'>obj</span><span class='period'>.</span><span class='id identifier rubyid_new_record'>new_record</span> <span class='op'>=</span> <span class='kw'>false</span>
|
|
495
|
-
<span class='kw'>return</span> <span class='id identifier rubyid_obj'>obj</span>
|
|
922
|
+
<span class='id identifier rubyid_from_database'>from_database</span><span class='lparen'>(</span><span class='id identifier rubyid_item'>item</span><span class='rparen'>)</span>
|
|
496
923
|
<span class='kw'>else</span>
|
|
497
|
-
<span class='kw'>
|
|
924
|
+
<span class='kw'>nil</span>
|
|
498
925
|
<span class='kw'>end</span>
|
|
499
926
|
<span class='kw'>end</span></pre>
|
|
500
927
|
</td>
|
|
@@ -505,11 +932,11 @@
|
|
|
505
932
|
</div>
|
|
506
933
|
|
|
507
934
|
</div>
|
|
508
|
-
|
|
935
|
+
|
|
509
936
|
<div id="footer">
|
|
510
|
-
Generated on Thu
|
|
937
|
+
Generated on Thu Jun 27 21:59:10 2013 by
|
|
511
938
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
512
|
-
0.
|
|
939
|
+
0.8.6.1 (ruby-1.9.3).
|
|
513
940
|
</div>
|
|
514
941
|
|
|
515
942
|
</body>
|