dynamoid 0.4.0 → 0.4.1
Sign up to get free protection for your applications and to get access to all the features.
- data/Dynamoid.gemspec +5 -3
- data/README.markdown +2 -2
- data/VERSION +1 -1
- data/doc/Dynamoid.html +26 -14
- data/doc/Dynamoid/Adapter.html +33 -35
- data/doc/Dynamoid/Adapter/AwsSdk.html +177 -153
- data/doc/Dynamoid/Adapter/Local.html +144 -57
- data/doc/Dynamoid/Associations.html +3 -3
- data/doc/Dynamoid/Associations/Association.html +104 -1016
- data/doc/Dynamoid/Associations/BelongsTo.html +11 -192
- data/doc/Dynamoid/Associations/ClassMethods.html +17 -17
- data/doc/Dynamoid/Associations/HasAndBelongsToMany.html +15 -190
- data/doc/Dynamoid/Associations/HasMany.html +15 -190
- data/doc/Dynamoid/Associations/HasOne.html +11 -192
- data/doc/Dynamoid/Associations/ManyAssociation.html +1640 -0
- data/doc/Dynamoid/Associations/SingleAssociation.html +598 -0
- data/doc/Dynamoid/Components.html +4 -2
- data/doc/Dynamoid/Config.html +10 -10
- data/doc/Dynamoid/Config/Options.html +1 -1
- data/doc/Dynamoid/Criteria.html +1 -1
- data/doc/Dynamoid/Criteria/Chain.html +326 -22
- data/doc/Dynamoid/Criteria/ClassMethods.html +1 -1
- data/doc/Dynamoid/Document.html +181 -27
- data/doc/Dynamoid/Document/ClassMethods.html +392 -36
- data/doc/Dynamoid/Errors.html +1 -1
- data/doc/Dynamoid/Errors/DocumentNotValid.html +1 -1
- data/doc/Dynamoid/Errors/Error.html +1 -1
- data/doc/Dynamoid/Errors/InvalidField.html +1 -1
- data/doc/Dynamoid/Errors/MissingRangeKey.html +1 -1
- data/doc/Dynamoid/Fields.html +44 -24
- data/doc/Dynamoid/Fields/ClassMethods.html +60 -15
- data/doc/Dynamoid/Finders.html +1 -1
- data/doc/Dynamoid/Finders/ClassMethods.html +45 -31
- data/doc/Dynamoid/Indexes.html +7 -7
- data/doc/Dynamoid/Indexes/ClassMethods.html +6 -4
- data/doc/Dynamoid/Indexes/Index.html +47 -32
- data/doc/Dynamoid/Persistence.html +47 -49
- data/doc/Dynamoid/Persistence/ClassMethods.html +149 -47
- data/doc/Dynamoid/Validations.html +1 -1
- data/doc/_index.html +35 -13
- data/doc/class_list.html +1 -1
- data/doc/file.LICENSE.html +1 -1
- data/doc/file.README.html +37 -4
- data/doc/index.html +37 -4
- data/doc/method_list.html +320 -136
- data/doc/top-level-namespace.html +1 -1
- data/lib/dynamoid/adapter.rb +28 -30
- data/lib/dynamoid/adapter/aws_sdk.rb +23 -22
- data/lib/dynamoid/persistence.rb +33 -27
- metadata +6 -4
data/doc/Dynamoid/Errors.html
CHANGED
@@ -109,7 +109,7 @@
|
|
109
109
|
</div>
|
110
110
|
|
111
111
|
<div id="footer">
|
112
|
-
Generated on
|
112
|
+
Generated on Thu Apr 26 01:26:24 2012 by
|
113
113
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
114
114
|
0.7.5 (ruby-1.9.3).
|
115
115
|
</div>
|
@@ -201,7 +201,7 @@
|
|
201
201
|
</div>
|
202
202
|
|
203
203
|
<div id="footer">
|
204
|
-
Generated on
|
204
|
+
Generated on Thu Apr 26 01:26:24 2012 by
|
205
205
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
206
206
|
0.7.5 (ruby-1.9.3).
|
207
207
|
</div>
|
@@ -121,7 +121,7 @@
|
|
121
121
|
</div>
|
122
122
|
|
123
123
|
<div id="footer">
|
124
|
-
Generated on
|
124
|
+
Generated on Thu Apr 26 01:26:24 2012 by
|
125
125
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
126
126
|
0.7.5 (ruby-1.9.3).
|
127
127
|
</div>
|
@@ -124,7 +124,7 @@
|
|
124
124
|
</div>
|
125
125
|
|
126
126
|
<div id="footer">
|
127
|
-
Generated on
|
127
|
+
Generated on Thu Apr 26 01:26:24 2012 by
|
128
128
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
129
129
|
0.7.5 (ruby-1.9.3).
|
130
130
|
</div>
|
@@ -124,7 +124,7 @@
|
|
124
124
|
</div>
|
125
125
|
|
126
126
|
<div id="footer">
|
127
|
-
Generated on
|
127
|
+
Generated on Thu Apr 26 01:26:24 2012 by
|
128
128
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
129
129
|
0.7.5 (ruby-1.9.3).
|
130
130
|
</div>
|
data/doc/Dynamoid/Fields.html
CHANGED
@@ -283,12 +283,12 @@ specified with field, then they will be ignored.</p>
|
|
283
283
|
<pre class="lines">
|
284
284
|
|
285
285
|
|
286
|
-
|
287
|
-
|
288
|
-
|
286
|
+
48
|
287
|
+
49
|
288
|
+
50</pre>
|
289
289
|
</td>
|
290
290
|
<td>
|
291
|
-
<pre class="code"><span class="info file"># File 'lib/dynamoid/fields.rb', line
|
291
|
+
<pre class="code"><span class="info file"># File 'lib/dynamoid/fields.rb', line 48</span>
|
292
292
|
|
293
293
|
<span class='kw'>def</span> <span class='id identifier rubyid_attributes'>attributes</span>
|
294
294
|
<span class='ivar'>@attributes</span>
|
@@ -366,12 +366,12 @@ specified with field, then they will be ignored.</p>
|
|
366
366
|
<pre class="lines">
|
367
367
|
|
368
368
|
|
369
|
-
|
370
|
-
|
371
|
-
|
369
|
+
77
|
370
|
+
78
|
371
|
+
79</pre>
|
372
372
|
</td>
|
373
373
|
<td>
|
374
|
-
<pre class="code"><span class="info file"># File 'lib/dynamoid/fields.rb', line
|
374
|
+
<pre class="code"><span class="info file"># File 'lib/dynamoid/fields.rb', line 77</span>
|
375
375
|
|
376
376
|
<span class='kw'>def</span> <span class='id identifier rubyid_read_attribute'>read_attribute</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='rparen'>)</span>
|
377
377
|
<span class='id identifier rubyid_attributes'>attributes</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>
|
@@ -453,13 +453,13 @@ specified with field, then they will be ignored.</p>
|
|
453
453
|
<pre class="lines">
|
454
454
|
|
455
455
|
|
456
|
-
|
457
|
-
|
458
|
-
|
459
|
-
|
456
|
+
98
|
457
|
+
99
|
458
|
+
100
|
459
|
+
101</pre>
|
460
460
|
</td>
|
461
461
|
<td>
|
462
|
-
<pre class="code"><span class="info file"># File 'lib/dynamoid/fields.rb', line
|
462
|
+
<pre class="code"><span class="info file"># File 'lib/dynamoid/fields.rb', line 98</span>
|
463
463
|
|
464
464
|
<span class='kw'>def</span> <span class='id identifier rubyid_update_attribute'>update_attribute</span><span class='lparen'>(</span><span class='id identifier rubyid_attribute'>attribute</span><span class='comma'>,</span> <span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span>
|
465
465
|
<span class='id identifier rubyid_write_attribute'>write_attribute</span><span class='lparen'>(</span><span class='id identifier rubyid_attribute'>attribute</span><span class='comma'>,</span> <span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span>
|
@@ -527,13 +527,13 @@ specified with field, then they will be ignored.</p>
|
|
527
527
|
<pre class="lines">
|
528
528
|
|
529
529
|
|
530
|
-
|
531
|
-
|
532
|
-
|
533
|
-
|
530
|
+
87
|
531
|
+
88
|
532
|
+
89
|
533
|
+
90</pre>
|
534
534
|
</td>
|
535
535
|
<td>
|
536
|
-
<pre class="code"><span class="info file"># File 'lib/dynamoid/fields.rb', line
|
536
|
+
<pre class="code"><span class="info file"># File 'lib/dynamoid/fields.rb', line 87</span>
|
537
537
|
|
538
538
|
<span class='kw'>def</span> <span class='id identifier rubyid_update_attributes'>update_attributes</span><span class='lparen'>(</span><span class='id identifier rubyid_attributes'>attributes</span><span class='rparen'>)</span>
|
539
539
|
<span class='id identifier rubyid_attributes'>attributes</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_attribute'>attribute</span><span class='comma'>,</span> <span class='id identifier rubyid_value'>value</span><span class='op'>|</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_write_attribute'>write_attribute</span><span class='lparen'>(</span><span class='id identifier rubyid_attribute'>attribute</span><span class='comma'>,</span> <span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span><span class='rbrace'>}</span>
|
@@ -557,7 +557,7 @@ specified with field, then they will be ignored.</p>
|
|
557
557
|
|
558
558
|
</p><div class="docstring">
|
559
559
|
<div class="discussion">
|
560
|
-
<p>Write an attribute on the object.</p>
|
560
|
+
<p>Write an attribute on the object. Also marks the previous value as dirty.</p>
|
561
561
|
|
562
562
|
|
563
563
|
</div>
|
@@ -620,14 +620,34 @@ specified with field, then they will be ignored.</p>
|
|
620
620
|
<pre class="lines">
|
621
621
|
|
622
622
|
|
623
|
-
|
624
|
-
|
625
|
-
|
623
|
+
57
|
624
|
+
58
|
625
|
+
59
|
626
|
+
60
|
627
|
+
61
|
628
|
+
62
|
629
|
+
63
|
630
|
+
64
|
631
|
+
65
|
632
|
+
66
|
633
|
+
67
|
634
|
+
68
|
635
|
+
69</pre>
|
626
636
|
</td>
|
627
637
|
<td>
|
628
|
-
<pre class="code"><span class="info file"># File 'lib/dynamoid/fields.rb', line
|
638
|
+
<pre class="code"><span class="info file"># File 'lib/dynamoid/fields.rb', line 57</span>
|
629
639
|
|
630
640
|
<span class='kw'>def</span> <span class='id identifier rubyid_write_attribute'>write_attribute</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='comma'>,</span> <span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span>
|
641
|
+
<span class='kw'>if</span> <span class='lparen'>(</span><span class='id identifier rubyid_size'>size</span> <span class='op'>=</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span><span class='period'>.</span><span class='id identifier rubyid_size'>size</span><span class='rparen'>)</span> <span class='op'>></span> <span class='const'>MAX_ITEM_SIZE</span>
|
642
|
+
<span class='const'>Dynamoid</span><span class='period'>.</span><span class='id identifier rubyid_logger'>logger</span><span class='period'>.</span><span class='id identifier rubyid_warn'>warn</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>DynamoDB can't store items larger than </span><span class='embexpr_beg'>#{</span><span class='const'>MAX_ITEM_SIZE</span><span class='rbrace'>}</span><span class='tstring_content'> and the </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_name'>name</span><span class='rbrace'>}</span><span class='tstring_content'> field has a length of </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_size'>size</span><span class='rbrace'>}</span><span class='tstring_content'>.</span><span class='tstring_end'>"</span></span>
|
643
|
+
<span class='kw'>end</span>
|
644
|
+
|
645
|
+
<span class='id identifier rubyid_attribute_will_change!'>attribute_will_change!</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='rparen'>)</span> <span class='kw'>unless</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_read_attribute'>read_attribute</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_value'>value</span>
|
646
|
+
|
647
|
+
<span class='kw'>if</span> <span class='id identifier rubyid_association'>association</span> <span class='op'>=</span> <span class='ivar'>@associations</span><span class='lbracket'>[</span><span class='id identifier rubyid_name'>name</span><span class='rbracket'>]</span>
|
648
|
+
<span class='id identifier rubyid_association'>association</span><span class='period'>.</span><span class='id identifier rubyid_reset'>reset</span>
|
649
|
+
<span class='kw'>end</span>
|
650
|
+
|
631
651
|
<span class='id identifier rubyid_attributes'>attributes</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_value'>value</span>
|
632
652
|
<span class='kw'>end</span></pre>
|
633
653
|
</td>
|
@@ -640,7 +660,7 @@ specified with field, then they will be ignored.</p>
|
|
640
660
|
</div>
|
641
661
|
|
642
662
|
<div id="footer">
|
643
|
-
Generated on
|
663
|
+
Generated on Thu Apr 26 01:26:24 2012 by
|
644
664
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
645
665
|
0.7.5 (ruby-1.9.3).
|
646
666
|
</div>
|
@@ -111,6 +111,27 @@
|
|
111
111
|
<span class="summary_desc"><div class='inline'><p>Specify a field for a document.</p>
|
112
112
|
</div></span>
|
113
113
|
|
114
|
+
</li>
|
115
|
+
|
116
|
+
|
117
|
+
<li class="public ">
|
118
|
+
<span class="summary_signature">
|
119
|
+
|
120
|
+
<a href="#range-instance_method" title="#range (instance method)">- (Object) <strong>range</strong>(name, type = :string) </a>
|
121
|
+
|
122
|
+
|
123
|
+
|
124
|
+
</span>
|
125
|
+
|
126
|
+
|
127
|
+
|
128
|
+
|
129
|
+
|
130
|
+
|
131
|
+
|
132
|
+
|
133
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
134
|
+
|
114
135
|
</li>
|
115
136
|
|
116
137
|
|
@@ -215,7 +236,6 @@ default is string, but you can also specify :integer, :float, :set, :array, :dat
|
|
215
236
|
<pre class="lines">
|
216
237
|
|
217
238
|
|
218
|
-
29
|
219
239
|
30
|
220
240
|
31
|
221
241
|
32
|
@@ -225,25 +245,50 @@ default is string, but you can also specify :integer, :float, :set, :array, :dat
|
|
225
245
|
36
|
226
246
|
37
|
227
247
|
38
|
228
|
-
39
|
229
|
-
40
|
230
|
-
41</pre>
|
248
|
+
39</pre>
|
231
249
|
</td>
|
232
250
|
<td>
|
233
|
-
<pre class="code"><span class="info file"># File 'lib/dynamoid/fields.rb', line
|
251
|
+
<pre class="code"><span class="info file"># File 'lib/dynamoid/fields.rb', line 30</span>
|
234
252
|
|
235
253
|
<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>
|
236
254
|
<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>
|
237
255
|
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_attributes'>attributes</span><span class='lbracket'>[</span><span class='id identifier rubyid_name'>name</span><span class='rbracket'>]</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>
|
238
|
-
|
239
|
-
|
240
|
-
<span class='
|
241
|
-
<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='
|
242
|
-
|
243
|
-
<span class='
|
244
|
-
|
245
|
-
|
246
|
-
|
256
|
+
|
257
|
+
<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
|
+
<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
|
+
<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
|
+
<span class='kw'>end</span></pre>
|
263
|
+
</td>
|
264
|
+
</tr>
|
265
|
+
</table>
|
266
|
+
</div>
|
267
|
+
|
268
|
+
<div class="method_details ">
|
269
|
+
<p class="signature " id="range-instance_method">
|
270
|
+
|
271
|
+
- (<tt>Object</tt>) <strong>range</strong>(name, type = :string)
|
272
|
+
|
273
|
+
|
274
|
+
|
275
|
+
</p><table class="source_code">
|
276
|
+
<tr>
|
277
|
+
<td>
|
278
|
+
<pre class="lines">
|
279
|
+
|
280
|
+
|
281
|
+
41
|
282
|
+
42
|
283
|
+
43
|
284
|
+
44</pre>
|
285
|
+
</td>
|
286
|
+
<td>
|
287
|
+
<pre class="code"><span class="info file"># File 'lib/dynamoid/fields.rb', line 41</span>
|
288
|
+
|
289
|
+
<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
|
+
<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>
|
291
|
+
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_range_key'>range_key</span> <span class='op'>=</span> <span class='id identifier rubyid_name'>name</span>
|
247
292
|
<span class='kw'>end</span></pre>
|
248
293
|
</td>
|
249
294
|
</tr>
|
@@ -255,7 +300,7 @@ default is string, but you can also specify :integer, :float, :set, :array, :dat
|
|
255
300
|
</div>
|
256
301
|
|
257
302
|
<div id="footer">
|
258
|
-
Generated on
|
303
|
+
Generated on Thu Apr 26 01:26:24 2012 by
|
259
304
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
260
305
|
0.7.5 (ruby-1.9.3).
|
261
306
|
</div>
|
data/doc/Dynamoid/Finders.html
CHANGED
@@ -119,7 +119,7 @@ class level, like find, find_by_id, and the method_missing style finders.</p>
|
|
119
119
|
</div>
|
120
120
|
|
121
121
|
<div id="footer">
|
122
|
-
Generated on
|
122
|
+
Generated on Thu Apr 26 01:26:24 2012 by
|
123
123
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
124
124
|
0.7.5 (ruby-1.9.3).
|
125
125
|
</div>
|
@@ -95,7 +95,7 @@
|
|
95
95
|
<li class="public ">
|
96
96
|
<span class="summary_signature">
|
97
97
|
|
98
|
-
<a href="#find-instance_method" title="#find (instance method)">- (Dynamoid::Document) <strong>find</strong>(*
|
98
|
+
<a href="#find-instance_method" title="#find (instance method)">- (Dynamoid::Document) <strong>find</strong>(*ids) </a>
|
99
99
|
|
100
100
|
|
101
101
|
|
@@ -117,7 +117,7 @@
|
|
117
117
|
<li class="public ">
|
118
118
|
<span class="summary_signature">
|
119
119
|
|
120
|
-
<a href="#find_by_id-instance_method" title="#find_by_id (instance method)">- (Dynamoid::Document) <strong>find_by_id</strong>(id) </a>
|
120
|
+
<a href="#find_by_id-instance_method" title="#find_by_id (instance method)">- (Dynamoid::Document) <strong>find_by_id</strong>(id, options = {}) </a>
|
121
121
|
|
122
122
|
|
123
123
|
|
@@ -236,13 +236,6 @@
|
|
236
236
|
<pre class="lines">
|
237
237
|
|
238
238
|
|
239
|
-
56
|
240
|
-
57
|
241
|
-
58
|
242
|
-
59
|
243
|
-
60
|
244
|
-
61
|
245
|
-
62
|
246
239
|
63
|
247
240
|
64
|
248
241
|
65
|
@@ -252,10 +245,17 @@
|
|
252
245
|
69
|
253
246
|
70
|
254
247
|
71
|
255
|
-
72
|
248
|
+
72
|
249
|
+
73
|
250
|
+
74
|
251
|
+
75
|
252
|
+
76
|
253
|
+
77
|
254
|
+
78
|
255
|
+
79</pre>
|
256
256
|
</td>
|
257
257
|
<td>
|
258
|
-
<pre class="code"><span class="info file"># File 'lib/dynamoid/finders.rb', line
|
258
|
+
<pre class="code"><span class="info file"># File 'lib/dynamoid/finders.rb', line 63</span>
|
259
259
|
|
260
260
|
<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
261
|
<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>
|
@@ -289,7 +289,7 @@
|
|
289
289
|
<div class="method_details first">
|
290
290
|
<p class="signature first" id="find-instance_method">
|
291
291
|
|
292
|
-
- (<tt><span class='object_link'><a href="../Document.html" title="Dynamoid::Document (module)">Dynamoid::Document</a></span></tt>) <strong>find</strong>(*
|
292
|
+
- (<tt><span class='object_link'><a href="../Document.html" title="Dynamoid::Document (module)">Dynamoid::Document</a></span></tt>) <strong>find</strong>(*ids)
|
293
293
|
|
294
294
|
|
295
295
|
|
@@ -368,17 +368,31 @@
|
|
368
368
|
23
|
369
369
|
24
|
370
370
|
25
|
371
|
-
26
|
371
|
+
26
|
372
|
+
27
|
373
|
+
28
|
374
|
+
29
|
375
|
+
30
|
376
|
+
31
|
377
|
+
32
|
378
|
+
33</pre>
|
372
379
|
</td>
|
373
380
|
<td>
|
374
381
|
<pre class="code"><span class="info file"># File 'lib/dynamoid/finders.rb', line 18</span>
|
375
382
|
|
376
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_find'>find</span><span class='lparen'>(</span><span class='op'>*</span><span class='id identifier
|
377
|
-
|
378
|
-
<span class='kw'>if</span> <span class='id identifier
|
379
|
-
|
383
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_find'>find</span><span class='lparen'>(</span><span class='op'>*</span><span class='id identifier rubyid_ids'>ids</span><span class='rparen'>)</span>
|
384
|
+
|
385
|
+
<span class='id identifier rubyid_options'>options</span> <span class='op'>=</span> <span class='kw'>if</span> <span class='id identifier rubyid_ids'>ids</span><span class='period'>.</span><span class='id identifier rubyid_last'>last</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span> <span class='const'>Hash</span>
|
386
|
+
<span class='id identifier rubyid_ids'>ids</span><span class='period'>.</span><span class='id identifier rubyid_slice!'>slice!</span><span class='lparen'>(</span><span class='op'>-</span><span class='int'>1</span><span class='rparen'>)</span>
|
387
|
+
<span class='kw'>else</span>
|
388
|
+
<span class='lbrace'>{</span><span class='rbrace'>}</span>
|
389
|
+
<span class='kw'>end</span>
|
390
|
+
|
391
|
+
<span class='id identifier rubyid_ids'>ids</span> <span class='op'>=</span> <span class='const'>Array</span><span class='lparen'>(</span><span class='id identifier rubyid_ids'>ids</span><span class='period'>.</span><span class='id identifier rubyid_flatten'>flatten</span><span class='period'>.</span><span class='id identifier rubyid_uniq'>uniq</span><span class='rparen'>)</span>
|
392
|
+
<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
|
+
<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>
|
380
394
|
<span class='kw'>else</span>
|
381
|
-
<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
|
395
|
+
<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>
|
382
396
|
<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_collect'>collect</span><span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_i'>i</span><span class='op'>|</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_build'>build</span><span class='lparen'>(</span><span class='id identifier rubyid_i'>i</span><span class='rparen'>)</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_o'>o</span><span class='op'>|</span> <span class='id identifier rubyid_o'>o</span><span class='period'>.</span><span class='id identifier rubyid_new_record'>new_record</span> <span class='op'>=</span> <span class='kw'>false</span> <span class='rbrace'>}</span> <span class='rbrace'>}</span>
|
383
397
|
<span class='kw'>end</span>
|
384
398
|
<span class='kw'>end</span></pre>
|
@@ -390,7 +404,7 @@
|
|
390
404
|
<div class="method_details ">
|
391
405
|
<p class="signature " id="find_by_id-instance_method">
|
392
406
|
|
393
|
-
- (<tt><span class='object_link'><a href="../Document.html" title="Dynamoid::Document (module)">Dynamoid::Document</a></span></tt>) <strong>find_by_id</strong>(id)
|
407
|
+
- (<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 = {})
|
394
408
|
|
395
409
|
|
396
410
|
|
@@ -461,21 +475,21 @@
|
|
461
475
|
<pre class="lines">
|
462
476
|
|
463
477
|
|
464
|
-
35
|
465
|
-
36
|
466
|
-
37
|
467
|
-
38
|
468
|
-
39
|
469
|
-
40
|
470
|
-
41
|
471
478
|
42
|
472
|
-
43
|
479
|
+
43
|
480
|
+
44
|
481
|
+
45
|
482
|
+
46
|
483
|
+
47
|
484
|
+
48
|
485
|
+
49
|
486
|
+
50</pre>
|
473
487
|
</td>
|
474
488
|
<td>
|
475
|
-
<pre class="code"><span class="info file"># File 'lib/dynamoid/finders.rb', line
|
489
|
+
<pre class="code"><span class="info file"># File 'lib/dynamoid/finders.rb', line 42</span>
|
476
490
|
|
477
|
-
<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='rparen'>)</span>
|
478
|
-
<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='rparen'>)</span>
|
491
|
+
<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
|
+
<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>
|
479
493
|
<span class='id identifier rubyid_obj'>obj</span> <span class='op'>=</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_item'>item</span><span class='rparen'>)</span>
|
480
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>
|
481
495
|
<span class='kw'>return</span> <span class='id identifier rubyid_obj'>obj</span>
|
@@ -493,7 +507,7 @@
|
|
493
507
|
</div>
|
494
508
|
|
495
509
|
<div id="footer">
|
496
|
-
Generated on
|
510
|
+
Generated on Thu Apr 26 01:26:24 2012 by
|
497
511
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
498
512
|
0.7.5 (ruby-1.9.3).
|
499
513
|
</div>
|
data/doc/Dynamoid/Indexes.html
CHANGED
@@ -218,14 +218,14 @@ we perform indexing).</p>
|
|
218
218
|
<pre class="lines">
|
219
219
|
|
220
220
|
|
221
|
-
61
|
222
221
|
62
|
223
222
|
63
|
224
223
|
64
|
225
|
-
65
|
224
|
+
65
|
225
|
+
66</pre>
|
226
226
|
</td>
|
227
227
|
<td>
|
228
|
-
<pre class="code"><span class="info file"># File 'lib/dynamoid/indexes.rb', line
|
228
|
+
<pre class="code"><span class="info file"># File 'lib/dynamoid/indexes.rb', line 62</span>
|
229
229
|
|
230
230
|
<span class='kw'>def</span> <span class='id identifier rubyid_delete_indexes'>delete_indexes</span>
|
231
231
|
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span><span class='period'>.</span><span class='id identifier rubyid_indexes'>indexes</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_name'>name</span><span class='comma'>,</span> <span class='id identifier rubyid_index'>index</span><span class='op'>|</span>
|
@@ -275,14 +275,14 @@ we perform indexing).</p>
|
|
275
275
|
<pre class="lines">
|
276
276
|
|
277
277
|
|
278
|
-
52
|
279
278
|
53
|
280
279
|
54
|
281
280
|
55
|
282
|
-
56
|
281
|
+
56
|
282
|
+
57</pre>
|
283
283
|
</td>
|
284
284
|
<td>
|
285
|
-
<pre class="code"><span class="info file"># File 'lib/dynamoid/indexes.rb', line
|
285
|
+
<pre class="code"><span class="info file"># File 'lib/dynamoid/indexes.rb', line 53</span>
|
286
286
|
|
287
287
|
<span class='kw'>def</span> <span class='id identifier rubyid_save_indexes'>save_indexes</span>
|
288
288
|
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span><span class='period'>.</span><span class='id identifier rubyid_indexes'>indexes</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_name'>name</span><span class='comma'>,</span> <span class='id identifier rubyid_index'>index</span><span class='op'>|</span>
|
@@ -299,7 +299,7 @@ we perform indexing).</p>
|
|
299
299
|
</div>
|
300
300
|
|
301
301
|
<div id="footer">
|
302
|
-
Generated on
|
302
|
+
Generated on Thu Apr 26 01:26:24 2012 by
|
303
303
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
304
304
|
0.7.5 (ruby-1.9.3).
|
305
305
|
</div>
|