dynamoid 0.4.0 → 0.4.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (50) hide show
  1. data/Dynamoid.gemspec +5 -3
  2. data/README.markdown +2 -2
  3. data/VERSION +1 -1
  4. data/doc/Dynamoid.html +26 -14
  5. data/doc/Dynamoid/Adapter.html +33 -35
  6. data/doc/Dynamoid/Adapter/AwsSdk.html +177 -153
  7. data/doc/Dynamoid/Adapter/Local.html +144 -57
  8. data/doc/Dynamoid/Associations.html +3 -3
  9. data/doc/Dynamoid/Associations/Association.html +104 -1016
  10. data/doc/Dynamoid/Associations/BelongsTo.html +11 -192
  11. data/doc/Dynamoid/Associations/ClassMethods.html +17 -17
  12. data/doc/Dynamoid/Associations/HasAndBelongsToMany.html +15 -190
  13. data/doc/Dynamoid/Associations/HasMany.html +15 -190
  14. data/doc/Dynamoid/Associations/HasOne.html +11 -192
  15. data/doc/Dynamoid/Associations/ManyAssociation.html +1640 -0
  16. data/doc/Dynamoid/Associations/SingleAssociation.html +598 -0
  17. data/doc/Dynamoid/Components.html +4 -2
  18. data/doc/Dynamoid/Config.html +10 -10
  19. data/doc/Dynamoid/Config/Options.html +1 -1
  20. data/doc/Dynamoid/Criteria.html +1 -1
  21. data/doc/Dynamoid/Criteria/Chain.html +326 -22
  22. data/doc/Dynamoid/Criteria/ClassMethods.html +1 -1
  23. data/doc/Dynamoid/Document.html +181 -27
  24. data/doc/Dynamoid/Document/ClassMethods.html +392 -36
  25. data/doc/Dynamoid/Errors.html +1 -1
  26. data/doc/Dynamoid/Errors/DocumentNotValid.html +1 -1
  27. data/doc/Dynamoid/Errors/Error.html +1 -1
  28. data/doc/Dynamoid/Errors/InvalidField.html +1 -1
  29. data/doc/Dynamoid/Errors/MissingRangeKey.html +1 -1
  30. data/doc/Dynamoid/Fields.html +44 -24
  31. data/doc/Dynamoid/Fields/ClassMethods.html +60 -15
  32. data/doc/Dynamoid/Finders.html +1 -1
  33. data/doc/Dynamoid/Finders/ClassMethods.html +45 -31
  34. data/doc/Dynamoid/Indexes.html +7 -7
  35. data/doc/Dynamoid/Indexes/ClassMethods.html +6 -4
  36. data/doc/Dynamoid/Indexes/Index.html +47 -32
  37. data/doc/Dynamoid/Persistence.html +47 -49
  38. data/doc/Dynamoid/Persistence/ClassMethods.html +149 -47
  39. data/doc/Dynamoid/Validations.html +1 -1
  40. data/doc/_index.html +35 -13
  41. data/doc/class_list.html +1 -1
  42. data/doc/file.LICENSE.html +1 -1
  43. data/doc/file.README.html +37 -4
  44. data/doc/index.html +37 -4
  45. data/doc/method_list.html +320 -136
  46. data/doc/top-level-namespace.html +1 -1
  47. data/lib/dynamoid/adapter.rb +28 -30
  48. data/lib/dynamoid/adapter/aws_sdk.rb +23 -22
  49. data/lib/dynamoid/persistence.rb +33 -27
  50. metadata +6 -4
@@ -210,15 +210,17 @@
210
210
  43
211
211
  44
212
212
  45
213
- 46</pre>
213
+ 46
214
+ 47</pre>
214
215
  </td>
215
216
  <td>
216
217
  <pre class="code"><span class="info file"># File 'lib/dynamoid/indexes.rb', line 41</span>
217
218
 
218
219
  <span class='kw'>def</span> <span class='id identifier rubyid_create_indexes'>create_indexes</span>
219
220
  <span class='kw'>self</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>
220
- <span class='id identifier rubyid_opts'>opts</span> <span class='op'>=</span> <span class='id identifier rubyid_index'>index</span><span class='period'>.</span><span class='id identifier rubyid_range_key?'>range_key?</span> <span class='op'>?</span> <span class='lbrace'>{</span><span class='symbol'>:range_key</span> <span class='op'>=&gt;</span> <span class='symbol'>:range</span><span class='rbrace'>}</span> <span class='op'>:</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
221
- <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_create_table'>create_table</span><span class='lparen'>(</span><span class='id identifier rubyid_index'>index</span><span class='period'>.</span><span class='id identifier rubyid_table_name'>table_name</span><span class='comma'>,</span> <span class='symbol'>:id</span><span class='comma'>,</span> <span class='id identifier rubyid_opts'>opts</span><span class='rparen'>)</span> <span class='kw'>unless</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_table_exists?'>table_exists?</span><span class='lparen'>(</span><span class='id identifier rubyid_index'>index</span><span class='period'>.</span><span class='id identifier rubyid_table_name'>table_name</span><span class='rparen'>)</span>
221
+ <span class='id identifier rubyid_opts'>opts</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='symbol'>:table_name</span> <span class='op'>=&gt;</span> <span class='id identifier rubyid_index'>index</span><span class='period'>.</span><span class='id identifier rubyid_table_name'>table_name</span><span class='comma'>,</span> <span class='symbol'>:id</span> <span class='op'>=&gt;</span> <span class='symbol'>:id</span><span class='rbrace'>}</span>
222
+ <span class='id identifier rubyid_opts'>opts</span><span class='lbracket'>[</span><span class='symbol'>:range_key</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='lbrace'>{</span> <span class='symbol'>:range</span> <span class='op'>=&gt;</span> <span class='symbol'>:number</span> <span class='rbrace'>}</span> <span class='kw'>if</span> <span class='id identifier rubyid_index'>index</span><span class='period'>.</span><span class='id identifier rubyid_range_key?'>range_key?</span>
223
+ <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_create_table'>create_table</span><span class='lparen'>(</span><span class='id identifier rubyid_opts'>opts</span><span class='rparen'>)</span>
222
224
  <span class='kw'>end</span>
223
225
  <span class='kw'>end</span></pre>
224
226
  </td>
@@ -342,7 +344,7 @@ This function also attempts to immediately create the indexing table if it does
342
344
  </div>
343
345
 
344
346
  <div id="footer">
345
- Generated on Tue Mar 27 17:53:06 2012 by
347
+ Generated on Thu Apr 26 01:26:24 2012 by
346
348
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
347
349
  0.7.5 (ruby-1.9.3).
348
350
  </div>
@@ -227,7 +227,7 @@
227
227
  <li class="public ">
228
228
  <span class="summary_signature">
229
229
 
230
- <a href="#delete-instance_method" title="#delete (instance method)">- (Object) <strong>delete</strong>(obj) </a>
230
+ <a href="#delete-instance_method" title="#delete (instance method)">- (Object) <strong>delete</strong>(obj, changed_attributes = false) </a>
231
231
 
232
232
 
233
233
 
@@ -362,7 +362,7 @@ index doesn't already have this object in it.</p>
362
362
  <li class="public ">
363
363
  <span class="summary_signature">
364
364
 
365
- <a href="#values-instance_method" title="#values (instance method)">- (Hash) <strong>values</strong>(attrs) </a>
365
+ <a href="#values-instance_method" title="#values (instance method)">- (Hash) <strong>values</strong>(attrs, changed_attributes = false) </a>
366
366
 
367
367
 
368
368
 
@@ -690,7 +690,7 @@ index doesn't already have this object in it.</p>
690
690
  <div class="method_details first">
691
691
  <p class="signature first" id="delete-instance_method">
692
692
 
693
- - (<tt>Object</tt>) <strong>delete</strong>(obj)
693
+ - (<tt>Object</tt>) <strong>delete</strong>(obj, changed_attributes = false)
694
694
 
695
695
 
696
696
 
@@ -726,21 +726,21 @@ index doesn't already have this object in it.</p>
726
726
  <pre class="lines">
727
727
 
728
728
 
729
- 84
730
- 85
731
- 86
732
- 87
733
- 88
734
- 89
735
- 90</pre>
729
+ 93
730
+ 94
731
+ 95
732
+ 96
733
+ 97
734
+ 98
735
+ 99</pre>
736
736
  </td>
737
737
  <td>
738
- <pre class="code"><span class="info file"># File 'lib/dynamoid/indexes/index.rb', line 84</span>
738
+ <pre class="code"><span class="info file"># File 'lib/dynamoid/indexes/index.rb', line 93</span>
739
739
 
740
- <span class='kw'>def</span> <span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='id identifier rubyid_obj'>obj</span><span class='rparen'>)</span>
741
- <span class='id identifier rubyid_values'>values</span> <span class='op'>=</span> <span class='id identifier rubyid_values'>values</span><span class='lparen'>(</span><span class='id identifier rubyid_obj'>obj</span><span class='rparen'>)</span>
740
+ <span class='kw'>def</span> <span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='id identifier rubyid_obj'>obj</span><span class='comma'>,</span> <span class='id identifier rubyid_changed_attributes'>changed_attributes</span> <span class='op'>=</span> <span class='kw'>false</span><span class='rparen'>)</span>
741
+ <span class='id identifier rubyid_values'>values</span> <span class='op'>=</span> <span class='id identifier rubyid_values'>values</span><span class='lparen'>(</span><span class='id identifier rubyid_obj'>obj</span><span class='comma'>,</span> <span class='id identifier rubyid_changed_attributes'>changed_attributes</span><span class='rparen'>)</span>
742
742
  <span class='kw'>return</span> <span class='kw'>true</span> <span class='kw'>if</span> <span class='id identifier rubyid_values'>values</span><span class='lbracket'>[</span><span class='symbol'>:hash_value</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_blank?'>blank?</span> <span class='op'>||</span> <span class='lparen'>(</span><span class='op'>!</span><span class='id identifier rubyid_values'>values</span><span class='lbracket'>[</span><span class='symbol'>:range_value</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span> <span class='op'>&amp;&amp;</span> <span class='id identifier rubyid_values'>values</span><span class='lbracket'>[</span><span class='symbol'>:range_value</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_blank?'>blank?</span><span class='rparen'>)</span>
743
- <span class='id identifier rubyid_existing'>existing</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_values'>values</span><span class='lbracket'>[</span><span class='symbol'>:hash_value</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='id identifier rubyid_values'>values</span><span class='lbracket'>[</span><span class='symbol'>:range_value</span><span class='rbracket'>]</span><span class='rparen'>)</span>
743
+ <span class='id identifier rubyid_existing'>existing</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_values'>values</span><span class='lbracket'>[</span><span class='symbol'>:hash_value</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='lbrace'>{</span> <span class='symbol'>:range_key</span> <span class='op'>=&gt;</span> <span class='id identifier rubyid_values'>values</span><span class='lbracket'>[</span><span class='symbol'>:range_value</span><span class='rbracket'>]</span><span class='rbrace'>}</span><span class='rparen'>)</span>
744
744
  <span class='kw'>return</span> <span class='kw'>true</span> <span class='kw'>unless</span> <span class='id identifier rubyid_existing'>existing</span> <span class='op'>&amp;&amp;</span> <span class='id identifier rubyid_existing'>existing</span><span class='lbracket'>[</span><span class='symbol'>:ids</span><span class='rbracket'>]</span> <span class='op'>&amp;&amp;</span> <span class='id identifier rubyid_existing'>existing</span><span class='lbracket'>[</span><span class='symbol'>:ids</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_include?'>include?</span><span class='lparen'>(</span><span class='id identifier rubyid_obj'>obj</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span><span class='rparen'>)</span>
745
745
  <span class='const'>Dynamoid</span><span class='op'>::</span><span class='const'>Adapter</span><span class='period'>.</span><span class='id identifier rubyid_write'>write</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='lbrace'>{</span><span class='symbol'>:id</span> <span class='op'>=&gt;</span> <span class='id identifier rubyid_values'>values</span><span class='lbracket'>[</span><span class='symbol'>:hash_value</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='symbol'>:ids</span> <span class='op'>=&gt;</span> <span class='lparen'>(</span><span class='id identifier rubyid_existing'>existing</span><span class='lbracket'>[</span><span class='symbol'>:ids</span><span class='rbracket'>]</span> <span class='op'>-</span> <span class='const'>Set</span><span class='lbracket'>[</span><span class='id identifier rubyid_obj'>obj</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span><span class='rbracket'>]</span><span class='rparen'>)</span><span class='comma'>,</span> <span class='symbol'>:range</span> <span class='op'>=&gt;</span> <span class='id identifier rubyid_values'>values</span><span class='lbracket'>[</span><span class='symbol'>:range_value</span><span class='rbracket'>]</span><span class='rbrace'>}</span><span class='rparen'>)</span>
746
746
  <span class='kw'>end</span></pre>
@@ -811,7 +811,8 @@ index doesn't already have this object in it.</p>
811
811
 
812
812
  </p><div class="docstring">
813
813
  <div class="discussion">
814
- <p>Save an object to this index, merging it with existing ids if there's already something present at this index location.</p>
814
+ <p>Save an object to this index, merging it with existing ids if there's already something present at this index location.
815
+ First, though, delete this object from its old indexes (so the object isn't listed in an erroneous index).</p>
815
816
 
816
817
 
817
818
  </div>
@@ -840,21 +841,23 @@ index doesn't already have this object in it.</p>
840
841
  <pre class="lines">
841
842
 
842
843
 
843
- 72
844
- 73
845
- 74
846
- 75
847
- 76
848
- 77
849
- 78</pre>
844
+ 80
845
+ 81
846
+ 82
847
+ 83
848
+ 84
849
+ 85
850
+ 86
851
+ 87</pre>
850
852
  </td>
851
853
  <td>
852
- <pre class="code"><span class="info file"># File 'lib/dynamoid/indexes/index.rb', line 72</span>
854
+ <pre class="code"><span class="info file"># File 'lib/dynamoid/indexes/index.rb', line 80</span>
853
855
 
854
856
  <span class='kw'>def</span> <span class='id identifier rubyid_save'>save</span><span class='lparen'>(</span><span class='id identifier rubyid_obj'>obj</span><span class='rparen'>)</span>
857
+ <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='id identifier rubyid_obj'>obj</span><span class='comma'>,</span> <span class='kw'>true</span><span class='rparen'>)</span>
855
858
  <span class='id identifier rubyid_values'>values</span> <span class='op'>=</span> <span class='id identifier rubyid_values'>values</span><span class='lparen'>(</span><span class='id identifier rubyid_obj'>obj</span><span class='rparen'>)</span>
856
859
  <span class='kw'>return</span> <span class='kw'>true</span> <span class='kw'>if</span> <span class='id identifier rubyid_values'>values</span><span class='lbracket'>[</span><span class='symbol'>:hash_value</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_blank?'>blank?</span> <span class='op'>||</span> <span class='lparen'>(</span><span class='op'>!</span><span class='id identifier rubyid_values'>values</span><span class='lbracket'>[</span><span class='symbol'>:range_value</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span> <span class='op'>&amp;&amp;</span> <span class='id identifier rubyid_values'>values</span><span class='lbracket'>[</span><span class='symbol'>:range_value</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_blank?'>blank?</span><span class='rparen'>)</span>
857
- <span class='id identifier rubyid_existing'>existing</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_values'>values</span><span class='lbracket'>[</span><span class='symbol'>:hash_value</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='id identifier rubyid_values'>values</span><span class='lbracket'>[</span><span class='symbol'>:range_value</span><span class='rbracket'>]</span><span class='rparen'>)</span>
860
+ <span class='id identifier rubyid_existing'>existing</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_values'>values</span><span class='lbracket'>[</span><span class='symbol'>:hash_value</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='lbrace'>{</span> <span class='symbol'>:range_key</span> <span class='op'>=&gt;</span> <span class='id identifier rubyid_values'>values</span><span class='lbracket'>[</span><span class='symbol'>:range_value</span><span class='rbracket'>]</span> <span class='rbrace'>}</span><span class='rparen'>)</span>
858
861
  <span class='id identifier rubyid_ids'>ids</span> <span class='op'>=</span> <span class='lparen'>(</span><span class='lparen'>(</span><span class='id identifier rubyid_existing'>existing</span> <span class='kw'>and</span> <span class='id identifier rubyid_existing'>existing</span><span class='lbracket'>[</span><span class='symbol'>:ids</span><span class='rbracket'>]</span><span class='rparen'>)</span> <span class='kw'>or</span> <span class='const'>Set</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='rparen'>)</span>
859
862
  <span class='const'>Dynamoid</span><span class='op'>::</span><span class='const'>Adapter</span><span class='period'>.</span><span class='id identifier rubyid_write'>write</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='lbrace'>{</span><span class='symbol'>:id</span> <span class='op'>=&gt;</span> <span class='id identifier rubyid_values'>values</span><span class='lbracket'>[</span><span class='symbol'>:hash_value</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='symbol'>:ids</span> <span class='op'>=&gt;</span> <span class='id identifier rubyid_ids'>ids</span><span class='period'>.</span><span class='id identifier rubyid_merge'>merge</span><span class='lparen'>(</span><span class='lbracket'>[</span><span class='id identifier rubyid_obj'>obj</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span><span class='rbracket'>]</span><span class='rparen'>)</span><span class='comma'>,</span> <span class='symbol'>:range</span> <span class='op'>=&gt;</span> <span class='id identifier rubyid_values'>values</span><span class='lbracket'>[</span><span class='symbol'>:range_value</span><span class='rbracket'>]</span><span class='rbrace'>}</span><span class='rparen'>)</span>
860
863
  <span class='kw'>end</span></pre>
@@ -981,13 +984,15 @@ index doesn't already have this object in it.</p>
981
984
  <div class="method_details ">
982
985
  <p class="signature " id="values-instance_method">
983
986
 
984
- - (<tt>Hash</tt>) <strong>values</strong>(attrs)
987
+ - (<tt>Hash</tt>) <strong>values</strong>(attrs, changed_attributes = false)
985
988
 
986
989
 
987
990
 
988
991
  </p><div class="docstring">
989
992
  <div class="discussion">
990
- <p>Given either an object or a list of attributes, generate a hash key and a range key for the index.</p>
993
+ <p>Given either an object or a list of attributes, generate a hash key and a range key for the index. Optionally pass in
994
+ true to changed_attributes for a list of all the object's dirty attributes in convenient index form (for deleting stale
995
+ information from the indexes).</p>
991
996
 
992
997
 
993
998
  </div>
@@ -1052,18 +1057,28 @@ index doesn't already have this object in it.</p>
1052
1057
  <pre class="lines">
1053
1058
 
1054
1059
 
1055
- 61
1056
- 62
1057
1060
  63
1058
1061
  64
1059
1062
  65
1060
1063
  66
1061
- 67</pre>
1064
+ 67
1065
+ 68
1066
+ 69
1067
+ 70
1068
+ 71
1069
+ 72
1070
+ 73
1071
+ 74</pre>
1062
1072
  </td>
1063
1073
  <td>
1064
- <pre class="code"><span class="info file"># File 'lib/dynamoid/indexes/index.rb', line 61</span>
1074
+ <pre class="code"><span class="info file"># File 'lib/dynamoid/indexes/index.rb', line 63</span>
1065
1075
 
1066
- <span class='kw'>def</span> <span class='id identifier rubyid_values'>values</span><span class='lparen'>(</span><span class='id identifier rubyid_attrs'>attrs</span><span class='rparen'>)</span>
1076
+ <span class='kw'>def</span> <span class='id identifier rubyid_values'>values</span><span class='lparen'>(</span><span class='id identifier rubyid_attrs'>attrs</span><span class='comma'>,</span> <span class='id identifier rubyid_changed_attributes'>changed_attributes</span> <span class='op'>=</span> <span class='kw'>false</span><span class='rparen'>)</span>
1077
+ <span class='kw'>if</span> <span class='id identifier rubyid_changed_attributes'>changed_attributes</span>
1078
+ <span class='id identifier rubyid_hash'>hash</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
1079
+ <span class='id identifier rubyid_attrs'>attrs</span><span class='period'>.</span><span class='id identifier rubyid_changes'>changes</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_k'>k</span><span class='comma'>,</span> <span class='id identifier rubyid_v'>v</span><span class='op'>|</span> <span class='id identifier rubyid_hash'>hash</span><span class='lbracket'>[</span><span class='id identifier rubyid_k'>k</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='lparen'>(</span><span class='id identifier rubyid_v'>v</span><span class='period'>.</span><span class='id identifier rubyid_first'>first</span> <span class='op'>||</span> <span class='id identifier rubyid_v'>v</span><span class='period'>.</span><span class='id identifier rubyid_last'>last</span><span class='rparen'>)</span><span class='rbrace'>}</span>
1080
+ <span class='id identifier rubyid_attrs'>attrs</span> <span class='op'>=</span> <span class='id identifier rubyid_hash'>hash</span>
1081
+ <span class='kw'>end</span>
1067
1082
  <span class='id identifier rubyid_attrs'>attrs</span> <span class='op'>=</span> <span class='id identifier rubyid_attrs'>attrs</span><span class='period'>.</span><span class='id identifier rubyid_send'>send</span><span class='lparen'>(</span><span class='symbol'>:attributes</span><span class='rparen'>)</span> <span class='kw'>if</span> <span class='id identifier rubyid_attrs'>attrs</span><span class='period'>.</span><span class='id identifier rubyid_respond_to?'>respond_to?</span><span class='lparen'>(</span><span class='symbol'>:attributes</span><span class='rparen'>)</span>
1068
1083
  <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='period'>.</span><span class='id identifier rubyid_tap'>tap</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_hash'>hash</span><span class='op'>|</span>
1069
1084
  <span class='id identifier rubyid_hash'>hash</span><span class='lbracket'>[</span><span class='symbol'>:hash_value</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_hash_keys'>hash_keys</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_key'>key</span><span class='op'>|</span> <span class='id identifier rubyid_attrs'>attrs</span><span class='lbracket'>[</span><span class='id identifier rubyid_key'>key</span><span class='rbracket'>]</span><span class='rbrace'>}</span><span class='period'>.</span><span class='id identifier rubyid_join'>join</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>.</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
@@ -1080,7 +1095,7 @@ index doesn't already have this object in it.</p>
1080
1095
  </div>
1081
1096
 
1082
1097
  <div id="footer">
1083
- Generated on Tue Mar 27 17:53:07 2012 by
1098
+ Generated on Thu Apr 26 01:26:25 2012 by
1084
1099
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
1085
1100
  0.7.5 (ruby-1.9.3).
1086
1101
  </div>
@@ -361,13 +361,13 @@ values to be of the same type as when they were passed in, based on the fields i
361
361
  <pre class="lines">
362
362
 
363
363
 
364
- 129
365
- 130
366
- 131
367
- 132</pre>
364
+ 141
365
+ 142
366
+ 143
367
+ 144</pre>
368
368
  </td>
369
369
  <td>
370
- <pre class="code"><span class="info file"># File 'lib/dynamoid/persistence.rb', line 129</span>
370
+ <pre class="code"><span class="info file"># File 'lib/dynamoid/persistence.rb', line 141</span>
371
371
 
372
372
  <span class='kw'>def</span> <span class='id identifier rubyid_delete'>delete</span>
373
373
  <span class='id identifier rubyid_delete_indexes'>delete_indexes</span>
@@ -416,15 +416,15 @@ values to be of the same type as when they were passed in, based on the fields i
416
416
  <pre class="lines">
417
417
 
418
418
 
419
- 119
420
- 120
421
- 121
422
- 122
423
- 123
424
- 124</pre>
419
+ 131
420
+ 132
421
+ 133
422
+ 134
423
+ 135
424
+ 136</pre>
425
425
  </td>
426
426
  <td>
427
- <pre class="code"><span class="info file"># File 'lib/dynamoid/persistence.rb', line 119</span>
427
+ <pre class="code"><span class="info file"># File 'lib/dynamoid/persistence.rb', line 131</span>
428
428
 
429
429
  <span class='kw'>def</span> <span class='id identifier rubyid_destroy'>destroy</span>
430
430
  <span class='id identifier rubyid_run_callbacks'>run_callbacks</span><span class='lparen'>(</span><span class='symbol'>:destroy</span><span class='rparen'>)</span> <span class='kw'>do</span>
@@ -475,16 +475,16 @@ values to be of the same type as when they were passed in, based on the fields i
475
475
  <pre class="lines">
476
476
 
477
477
 
478
- 137
479
- 138
480
- 139
481
- 140
482
- 141
483
- 142
484
- 143</pre>
478
+ 149
479
+ 150
480
+ 151
481
+ 152
482
+ 153
483
+ 154
484
+ 155</pre>
485
485
  </td>
486
486
  <td>
487
- <pre class="code"><span class="info file"># File 'lib/dynamoid/persistence.rb', line 137</span>
487
+ <pre class="code"><span class="info file"># File 'lib/dynamoid/persistence.rb', line 149</span>
488
488
 
489
489
  <span class='kw'>def</span> <span class='id identifier rubyid_dump'>dump</span>
490
490
  <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='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_hash'>hash</span><span class='op'>|</span>
@@ -549,12 +549,12 @@ values to be of the same type as when they were passed in, based on the fields i
549
549
  <pre class="lines">
550
550
 
551
551
 
552
- 94
553
- 95
554
- 96</pre>
552
+ 107
553
+ 108
554
+ 109</pre>
555
555
  </td>
556
556
  <td>
557
- <pre class="code"><span class="info file"># File 'lib/dynamoid/persistence.rb', line 94</span>
557
+ <pre class="code"><span class="info file"># File 'lib/dynamoid/persistence.rb', line 107</span>
558
558
 
559
559
  <span class='kw'>def</span> <span class='id identifier rubyid_persisted?'>persisted?</span>
560
560
  <span class='op'>!</span><span class='id identifier rubyid_new_record?'>new_record?</span>
@@ -602,36 +602,34 @@ values to be of the same type as when they were passed in, based on the fields i
602
602
  <pre class="lines">
603
603
 
604
604
 
605
- 101
606
- 102
607
- 103
608
- 104
609
- 105
610
- 106
611
- 107
612
- 108
613
- 109
614
- 110
615
- 111
616
- 112
617
- 113
618
- 114</pre>
605
+ 114
606
+ 115
607
+ 116
608
+ 117
609
+ 118
610
+ 119
611
+ 120
612
+ 121
613
+ 122
614
+ 123
615
+ 124
616
+ 125
617
+ 126</pre>
619
618
  </td>
620
619
  <td>
621
- <pre class="code"><span class="info file"># File 'lib/dynamoid/persistence.rb', line 101</span>
620
+ <pre class="code"><span class="info file"># File 'lib/dynamoid/persistence.rb', line 114</span>
622
621
 
623
622
  <span class='kw'>def</span> <span class='id identifier rubyid_save'>save</span><span class='lparen'>(</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>
624
- <span class='kw'>if</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_new_record?'>new_record?</span>
625
- <span class='id identifier rubyid_run_callbacks'>run_callbacks</span><span class='lparen'>(</span><span class='symbol'>:create</span><span class='rparen'>)</span> <span class='kw'>do</span>
626
- <span class='id identifier rubyid_run_callbacks'>run_callbacks</span><span class='lparen'>(</span><span class='symbol'>:save</span><span class='rparen'>)</span> <span class='kw'>do</span>
627
- <span class='id identifier rubyid_persist'>persist</span>
628
- <span class='kw'>end</span>
629
- <span class='kw'>end</span>
623
+ <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_create_table'>create_table</span>
624
+
625
+ <span class='ivar'>@previously_changed</span> <span class='op'>=</span> <span class='id identifier rubyid_changes'>changes</span>
626
+
627
+ <span class='kw'>if</span> <span class='id identifier rubyid_new_record?'>new_record?</span>
628
+ <span class='id identifier rubyid_run_callbacks'>run_callbacks</span><span class='lparen'>(</span><span class='symbol'>:create</span><span class='rparen'>)</span> <span class='lbrace'>{</span> <span class='id identifier rubyid_persist'>persist</span> <span class='rbrace'>}</span>
630
629
  <span class='kw'>else</span>
631
- <span class='id identifier rubyid_run_callbacks'>run_callbacks</span><span class='lparen'>(</span><span class='symbol'>:save</span><span class='rparen'>)</span> <span class='kw'>do</span>
632
- <span class='id identifier rubyid_persist'>persist</span>
633
- <span class='kw'>end</span>
630
+ <span class='id identifier rubyid_persist'>persist</span>
634
631
  <span class='kw'>end</span>
632
+
635
633
  <span class='kw'>self</span>
636
634
  <span class='kw'>end</span></pre>
637
635
  </td>
@@ -644,7 +642,7 @@ values to be of the same type as when they were passed in, based on the fields i
644
642
  </div>
645
643
 
646
644
  <div id="footer">
647
- Generated on Tue Mar 27 17:53:06 2012 by
645
+ Generated on Thu Apr 26 01:26:25 2012 by
648
646
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
649
647
  0.7.5 (ruby-1.9.3).
650
648
  </div>
@@ -95,7 +95,7 @@
95
95
  <li class="public ">
96
96
  <span class="summary_signature">
97
97
 
98
- <a href="#create_table-instance_method" title="#create_table (instance method)">- (Object) <strong>create_table</strong>(table_name, id = :id, options = {}) </a>
98
+ <a href="#create_table-instance_method" title="#create_table (instance method)">- (Object) <strong>create_table</strong>(options = {}) </a>
99
99
 
100
100
 
101
101
 
@@ -108,7 +108,7 @@
108
108
 
109
109
 
110
110
 
111
- <span class="summary_desc"><div class='inline'><p>Creates a table for a given table name, hash key, and range key.</p>
111
+ <span class="summary_desc"><div class='inline'><p>Creates a table.</p>
112
112
  </div></span>
113
113
 
114
114
  </li>
@@ -214,19 +214,99 @@
214
214
  <div class="method_details first">
215
215
  <p class="signature first" id="create_table-instance_method">
216
216
 
217
- - (<tt>Object</tt>) <strong>create_table</strong>(table_name, id = :id, options = {})
217
+ - (<tt>Object</tt>) <strong>create_table</strong>(options = {})
218
218
 
219
219
 
220
220
 
221
221
  </p><div class="docstring">
222
222
  <div class="discussion">
223
- <p>Creates a table for a given table name, hash key, and range key.</p>
223
+ <p>Creates a table.</p>
224
224
 
225
225
 
226
226
  </div>
227
227
  </div>
228
228
  <div class="tags">
229
+ <h3>Parameters:</h3>
230
+ <ul class="param">
229
231
 
232
+ <li>
233
+
234
+ <span class='name'>options</span>
235
+
236
+
237
+ <span class='type'>(<tt>Hash</tt>)</span>
238
+
239
+
240
+ <em class="default">(defaults to: <tt>{}</tt>)</em>
241
+
242
+
243
+ &mdash;
244
+ <div class='inline'><p>options to pass for table creation</p>
245
+ </div>
246
+
247
+ </li>
248
+
249
+ </ul>
250
+
251
+
252
+
253
+
254
+ <h3>Options Hash (<tt>options</tt>):</h3>
255
+ <ul class="option">
256
+
257
+ <li>
258
+ <span class="name">:id</span>
259
+ <span class="type">(<tt>Symbol</tt>)</span>
260
+ <span class="default">
261
+
262
+ </span>
263
+ &mdash; <div class='inline'><p>the id field for the table</p>
264
+ </div>
265
+ </li>
266
+
267
+ <li>
268
+ <span class="name">:table_name</span>
269
+ <span class="type">(<tt>Symbol</tt>)</span>
270
+ <span class="default">
271
+
272
+ </span>
273
+ &mdash; <div class='inline'><p>the actual name for the table</p>
274
+ </div>
275
+ </li>
276
+
277
+ <li>
278
+ <span class="name">:read_capacity</span>
279
+ <span class="type">(<tt>Integer</tt>)</span>
280
+ <span class="default">
281
+
282
+ </span>
283
+ &mdash; <div class='inline'><p>set the read capacity for the table; does not work on existing tables</p>
284
+ </div>
285
+ </li>
286
+
287
+ <li>
288
+ <span class="name">:write_capacity</span>
289
+ <span class="type">(<tt>Integer</tt>)</span>
290
+ <span class="default">
291
+
292
+ </span>
293
+ &mdash; <div class='inline'><p>set the write capacity for the table; does not work on existing tables</p>
294
+ </div>
295
+ </li>
296
+
297
+ <li>
298
+ <span class="name">{range_key</span>
299
+ <span class="type">(<tt>Hash</tt>)</span>
300
+ <span class="default">
301
+
302
+ </span>
303
+ &mdash; <div class='inline'><p>=&gt; :type} a hash of the name of the range key and a symbol of its type</p>
304
+ </div>
305
+ </li>
306
+
307
+ </ul>
308
+
309
+
230
310
  <h3>Since:</h3>
231
311
  <ul class="since">
232
312
 
@@ -236,7 +316,7 @@
236
316
 
237
317
 
238
318
 
239
- <div class='inline'><p>0.2.0</p>
319
+ <div class='inline'><p>0.4.0</p>
240
320
  </div>
241
321
 
242
322
  </li>
@@ -249,15 +329,35 @@
249
329
  <pre class="lines">
250
330
 
251
331
 
252
- 26
253
- 27
254
- 28</pre>
332
+ 33
333
+ 34
334
+ 35
335
+ 36
336
+ 37
337
+ 38
338
+ 39
339
+ 40
340
+ 41
341
+ 42
342
+ 43
343
+ 44
344
+ 45</pre>
255
345
  </td>
256
346
  <td>
257
- <pre class="code"><span class="info file"># File 'lib/dynamoid/persistence.rb', line 26</span>
347
+ <pre class="code"><span class="info file"># File 'lib/dynamoid/persistence.rb', line 33</span>
258
348
 
259
- <span class='kw'>def</span> <span class='id identifier rubyid_create_table'>create_table</span><span class='lparen'>(</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='op'>=</span> <span class='symbol'>: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>
260
- <span class='const'>Dynamoid</span><span class='op'>::</span><span class='const'>Adapter</span><span class='period'>.</span><span class='id identifier rubyid_tables'>tables</span> <span class='op'>&lt;&lt;</span> <span class='id identifier rubyid_table_name'>table_name</span> <span class='kw'>if</span> <span class='const'>Dynamoid</span><span class='op'>::</span><span class='const'>Adapter</span><span class='period'>.</span><span class='id identifier rubyid_create_table'>create_table</span><span class='lparen'>(</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='period'>.</span><span class='id identifier rubyid_to_sym'>to_sym</span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span><span class='rparen'>)</span>
349
+ <span class='kw'>def</span> <span class='id identifier rubyid_create_table'>create_table</span><span class='lparen'>(</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>
350
+ <span class='id identifier rubyid_options'>options</span> <span class='op'>=</span> <span class='lbrace'>{</span>
351
+ <span class='symbol'>:id</span> <span class='op'>=&gt;</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_hash_key'>hash_key</span><span class='comma'>,</span>
352
+ <span class='symbol'>:table_name</span> <span class='op'>=&gt;</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_table_name'>table_name</span><span class='comma'>,</span>
353
+ <span class='symbol'>:write_capacity</span> <span class='op'>=&gt;</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_write_capacity'>write_capacity</span><span class='comma'>,</span>
354
+ <span class='symbol'>:read_capacity</span> <span class='op'>=&gt;</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_read_capacity'>read_capacity</span><span class='comma'>,</span>
355
+ <span class='symbol'>:range_key</span> <span class='op'>=&gt;</span> <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='lbrace'>{</span><span class='id identifier rubyid_range_key'>range_key</span> <span class='op'>=&gt;</span> <span class='id identifier rubyid_attributes'>attributes</span><span class='lbracket'>[</span><span class='id identifier rubyid_range_key'>range_key</span><span class='rbracket'>]</span><span class='lbracket'>[</span><span class='symbol'>:type</span><span class='rbracket'>]</span><span class='rbrace'>}</span> <span class='op'>:</span> <span class='kw'>nil</span>
356
+ <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>
357
+
358
+ <span class='kw'>return</span> <span class='kw'>true</span> <span class='kw'>if</span> <span class='id identifier rubyid_table_exists?'>table_exists?</span><span class='lparen'>(</span><span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:table_name</span><span class='rbracket'>]</span><span class='rparen'>)</span>
359
+
360
+ <span class='const'>Dynamoid</span><span class='op'>::</span><span class='const'>Adapter</span><span class='period'>.</span><span class='id identifier rubyid_tables'>tables</span> <span class='op'>&lt;&lt;</span> <span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:table_name</span><span class='rbracket'>]</span> <span class='kw'>if</span> <span class='const'>Dynamoid</span><span class='op'>::</span><span class='const'>Adapter</span><span class='period'>.</span><span class='id identifier rubyid_create_table'>create_table</span><span class='lparen'>(</span><span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:table_name</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:id</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span><span class='rparen'>)</span>
261
361
  <span class='kw'>end</span></pre>
262
362
  </td>
263
363
  </tr>
@@ -315,12 +415,12 @@
315
415
  <pre class="lines">
316
416
 
317
417
 
318
- 33
319
- 34
320
- 35</pre>
418
+ 50
419
+ 51
420
+ 52</pre>
321
421
  </td>
322
422
  <td>
323
- <pre class="code"><span class="info file"># File 'lib/dynamoid/persistence.rb', line 33</span>
423
+ <pre class="code"><span class="info file"># File 'lib/dynamoid/persistence.rb', line 50</span>
324
424
 
325
425
  <span class='kw'>def</span> <span class='id identifier rubyid_table_exists?'>table_exists?</span><span class='lparen'>(</span><span class='id identifier rubyid_table_name'>table_name</span><span class='rparen'>)</span>
326
426
  <span class='const'>Dynamoid</span><span class='op'>::</span><span class='const'>Adapter</span><span class='period'>.</span><span class='id identifier rubyid_tables'>tables</span><span class='period'>.</span><span class='id identifier rubyid_include?'>include?</span><span class='lparen'>(</span><span class='id identifier rubyid_table_name'>table_name</span><span class='rparen'>)</span>
@@ -376,7 +476,7 @@
376
476
  <pre class="code"><span class="info file"># File 'lib/dynamoid/persistence.rb', line 19</span>
377
477
 
378
478
  <span class='kw'>def</span> <span class='id identifier rubyid_table_name'>table_name</span>
379
- <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='embexpr_beg'>#{</span><span class='const'>Dynamoid</span><span class='op'>::</span><span class='const'>Config</span><span class='period'>.</span><span class='id identifier rubyid_namespace'>namespace</span><span class='rbrace'>}</span><span class='tstring_content'>_</span><span class='embexpr_beg'>#{</span><span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span><span class='period'>.</span><span class='id identifier rubyid_downcase'>downcase</span><span class='period'>.</span><span class='id identifier rubyid_pluralize'>pluralize</span><span class='rbrace'>}</span><span class='tstring_end'>&quot;</span></span>
479
+ <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='embexpr_beg'>#{</span><span class='const'>Dynamoid</span><span class='op'>::</span><span class='const'>Config</span><span class='period'>.</span><span class='id identifier rubyid_namespace'>namespace</span><span class='rbrace'>}</span><span class='tstring_content'>_</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:name</span><span class='rbracket'>]</span> <span class='op'>?</span> <span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:name</span><span class='rbracket'>]</span> <span class='op'>:</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_name'>name</span><span class='period'>.</span><span class='id identifier rubyid_downcase'>downcase</span><span class='period'>.</span><span class='id identifier rubyid_pluralize'>pluralize</span><span class='rbrace'>}</span><span class='tstring_end'>&quot;</span></span>
380
480
  <span class='kw'>end</span></pre>
381
481
  </td>
382
482
  </tr>
@@ -421,24 +521,26 @@
421
521
  <pre class="lines">
422
522
 
423
523
 
424
- 40
425
- 41
426
- 42
427
- 43
428
- 44
429
- 45
430
- 46
431
- 47</pre>
524
+ 57
525
+ 58
526
+ 59
527
+ 60
528
+ 61
529
+ 62
530
+ 63
531
+ 64
532
+ 65</pre>
432
533
  </td>
433
534
  <td>
434
- <pre class="code"><span class="info file"># File 'lib/dynamoid/persistence.rb', line 40</span>
535
+ <pre class="code"><span class="info file"># File 'lib/dynamoid/persistence.rb', line 57</span>
435
536
 
436
537
  <span class='kw'>def</span> <span class='id identifier rubyid_undump'>undump</span><span class='lparen'>(</span><span class='id identifier rubyid_incoming'>incoming</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='rparen'>)</span>
437
- <span class='lparen'>(</span><span class='id identifier rubyid_incoming'>incoming</span> <span class='op'>||=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_symbolize_keys!'>symbolize_keys!</span>
538
+ <span class='id identifier rubyid_incoming'>incoming</span> <span class='op'>=</span> <span class='lparen'>(</span><span class='id identifier rubyid_incoming'>incoming</span> <span class='op'>||</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_symbolize_keys'>symbolize_keys</span>
438
539
  <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='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_hash'>hash</span><span class='op'>|</span>
439
540
  <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_attributes'>attributes</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_attribute'>attribute</span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span><span class='op'>|</span>
440
541
  <span class='id identifier rubyid_hash'>hash</span><span class='lbracket'>[</span><span class='id identifier rubyid_attribute'>attribute</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_undump_field'>undump_field</span><span class='lparen'>(</span><span class='id identifier rubyid_incoming'>incoming</span><span class='lbracket'>[</span><span class='id identifier rubyid_attribute'>attribute</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:type</span><span class='rbracket'>]</span><span class='rparen'>)</span>
441
542
  <span class='kw'>end</span>
543
+ <span class='id identifier rubyid_incoming'>incoming</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='id identifier rubyid_hash'>hash</span><span class='lbracket'>[</span><span class='id identifier rubyid_attribute'>attribute</span><span class='rbracket'>]</span> <span class='op'>||=</span> <span class='id identifier rubyid_value'>value</span> <span class='rbrace'>}</span>
442
544
  <span class='kw'>end</span>
443
545
  <span class='kw'>end</span></pre>
444
546
  </td>
@@ -485,24 +587,6 @@ string, integer, float, set, array, datetime, or serialized return value.</p>
485
587
  <pre class="lines">
486
588
 
487
589
 
488
- 53
489
- 54
490
- 55
491
- 56
492
- 57
493
- 58
494
- 59
495
- 60
496
- 61
497
- 62
498
- 63
499
- 64
500
- 65
501
- 66
502
- 67
503
- 68
504
- 69
505
- 70
506
590
  71
507
591
  72
508
592
  73
@@ -514,10 +598,28 @@ string, integer, float, set, array, datetime, or serialized return value.</p>
514
598
  79
515
599
  80
516
600
  81
517
- 82</pre>
601
+ 82
602
+ 83
603
+ 84
604
+ 85
605
+ 86
606
+ 87
607
+ 88
608
+ 89
609
+ 90
610
+ 91
611
+ 92
612
+ 93
613
+ 94
614
+ 95
615
+ 96
616
+ 97
617
+ 98
618
+ 99
619
+ 100</pre>
518
620
  </td>
519
621
  <td>
520
- <pre class="code"><span class="info file"># File 'lib/dynamoid/persistence.rb', line 53</span>
622
+ <pre class="code"><span class="info file"># File 'lib/dynamoid/persistence.rb', line 71</span>
521
623
 
522
624
  <span class='kw'>def</span> <span class='id identifier rubyid_undump_field'>undump_field</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='comma'>,</span> <span class='id identifier rubyid_type'>type</span><span class='rparen'>)</span>
523
625
  <span class='kw'>return</span> <span class='kw'>if</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span> <span class='op'>||</span> <span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_respond_to?'>respond_to?</span><span class='lparen'>(</span><span class='symbol'>:empty?</span><span class='rparen'>)</span> <span class='op'>&amp;&amp;</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_empty?'>empty?</span><span class='rparen'>)</span>
@@ -559,7 +661,7 @@ string, integer, float, set, array, datetime, or serialized return value.</p>
559
661
  </div>
560
662
 
561
663
  <div id="footer">
562
- Generated on Tue Mar 27 17:53:06 2012 by
664
+ Generated on Thu Apr 26 01:26:25 2012 by
563
665
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
564
666
  0.7.5 (ruby-1.9.3).
565
667
  </div>