dynamoid 0.7.1 → 1.0.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.
Files changed (123) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +2 -24
  3. data/README.markdown +89 -73
  4. data/Rakefile +10 -36
  5. data/dynamoid.gemspec +56 -191
  6. data/lib/dynamoid.rb +6 -4
  7. data/lib/dynamoid/adapter.rb +64 -150
  8. data/lib/dynamoid/adapter_plugin/aws_sdk_v2.rb +579 -0
  9. data/lib/dynamoid/components.rb +0 -1
  10. data/lib/dynamoid/config.rb +2 -5
  11. data/lib/dynamoid/criteria.rb +1 -1
  12. data/lib/dynamoid/criteria/chain.rb +27 -140
  13. data/lib/dynamoid/document.rb +2 -2
  14. data/lib/dynamoid/errors.rb +30 -9
  15. data/lib/dynamoid/fields.rb +15 -3
  16. data/lib/dynamoid/finders.rb +7 -6
  17. data/lib/dynamoid/identity_map.rb +1 -5
  18. data/lib/dynamoid/persistence.rb +108 -93
  19. metadata +56 -229
  20. data/.document +0 -5
  21. data/.rspec +0 -1
  22. data/.travis.yml +0 -7
  23. data/Gemfile.lock +0 -81
  24. data/Gemfile_activemodel4 +0 -24
  25. data/Gemfile_activemodel4.lock +0 -88
  26. data/VERSION +0 -1
  27. data/doc/.nojekyll +0 -0
  28. data/doc/Dynamoid.html +0 -328
  29. data/doc/Dynamoid/Adapter.html +0 -1872
  30. data/doc/Dynamoid/Adapter/AwsSdk.html +0 -2101
  31. data/doc/Dynamoid/Adapter/Local.html +0 -1574
  32. data/doc/Dynamoid/Associations.html +0 -138
  33. data/doc/Dynamoid/Associations/Association.html +0 -847
  34. data/doc/Dynamoid/Associations/BelongsTo.html +0 -161
  35. data/doc/Dynamoid/Associations/ClassMethods.html +0 -766
  36. data/doc/Dynamoid/Associations/HasAndBelongsToMany.html +0 -167
  37. data/doc/Dynamoid/Associations/HasMany.html +0 -167
  38. data/doc/Dynamoid/Associations/HasOne.html +0 -161
  39. data/doc/Dynamoid/Associations/ManyAssociation.html +0 -1684
  40. data/doc/Dynamoid/Associations/SingleAssociation.html +0 -627
  41. data/doc/Dynamoid/Components.html +0 -242
  42. data/doc/Dynamoid/Config.html +0 -412
  43. data/doc/Dynamoid/Config/Options.html +0 -638
  44. data/doc/Dynamoid/Criteria.html +0 -138
  45. data/doc/Dynamoid/Criteria/Chain.html +0 -1471
  46. data/doc/Dynamoid/Criteria/ClassMethods.html +0 -105
  47. data/doc/Dynamoid/Dirty.html +0 -424
  48. data/doc/Dynamoid/Dirty/ClassMethods.html +0 -174
  49. data/doc/Dynamoid/Document.html +0 -1033
  50. data/doc/Dynamoid/Document/ClassMethods.html +0 -1116
  51. data/doc/Dynamoid/Errors.html +0 -125
  52. data/doc/Dynamoid/Errors/ConditionalCheckFailedException.html +0 -141
  53. data/doc/Dynamoid/Errors/DocumentNotValid.html +0 -221
  54. data/doc/Dynamoid/Errors/Error.html +0 -137
  55. data/doc/Dynamoid/Errors/InvalidField.html +0 -141
  56. data/doc/Dynamoid/Errors/InvalidQuery.html +0 -131
  57. data/doc/Dynamoid/Errors/MissingRangeKey.html +0 -141
  58. data/doc/Dynamoid/Fields.html +0 -686
  59. data/doc/Dynamoid/Fields/ClassMethods.html +0 -438
  60. data/doc/Dynamoid/Finders.html +0 -135
  61. data/doc/Dynamoid/Finders/ClassMethods.html +0 -943
  62. data/doc/Dynamoid/IdentityMap.html +0 -492
  63. data/doc/Dynamoid/IdentityMap/ClassMethods.html +0 -534
  64. data/doc/Dynamoid/Indexes.html +0 -321
  65. data/doc/Dynamoid/Indexes/ClassMethods.html +0 -369
  66. data/doc/Dynamoid/Indexes/Index.html +0 -1142
  67. data/doc/Dynamoid/Middleware.html +0 -115
  68. data/doc/Dynamoid/Middleware/IdentityMap.html +0 -264
  69. data/doc/Dynamoid/Persistence.html +0 -892
  70. data/doc/Dynamoid/Persistence/ClassMethods.html +0 -836
  71. data/doc/Dynamoid/Validations.html +0 -415
  72. data/doc/_index.html +0 -506
  73. data/doc/class_list.html +0 -53
  74. data/doc/css/common.css +0 -1
  75. data/doc/css/full_list.css +0 -57
  76. data/doc/css/style.css +0 -338
  77. data/doc/file.LICENSE.html +0 -73
  78. data/doc/file.README.html +0 -416
  79. data/doc/file_list.html +0 -58
  80. data/doc/frames.html +0 -28
  81. data/doc/index.html +0 -416
  82. data/doc/js/app.js +0 -214
  83. data/doc/js/full_list.js +0 -178
  84. data/doc/js/jquery.js +0 -4
  85. data/doc/method_list.html +0 -1144
  86. data/doc/top-level-namespace.html +0 -112
  87. data/lib/dynamoid/adapter/aws_sdk.rb +0 -287
  88. data/lib/dynamoid/indexes.rb +0 -69
  89. data/lib/dynamoid/indexes/index.rb +0 -103
  90. data/spec/app/models/address.rb +0 -13
  91. data/spec/app/models/camel_case.rb +0 -34
  92. data/spec/app/models/car.rb +0 -6
  93. data/spec/app/models/magazine.rb +0 -11
  94. data/spec/app/models/message.rb +0 -9
  95. data/spec/app/models/nuclear_submarine.rb +0 -5
  96. data/spec/app/models/sponsor.rb +0 -8
  97. data/spec/app/models/subscription.rb +0 -12
  98. data/spec/app/models/tweet.rb +0 -12
  99. data/spec/app/models/user.rb +0 -26
  100. data/spec/app/models/vehicle.rb +0 -7
  101. data/spec/dynamoid/adapter/aws_sdk_spec.rb +0 -376
  102. data/spec/dynamoid/adapter_spec.rb +0 -155
  103. data/spec/dynamoid/associations/association_spec.rb +0 -194
  104. data/spec/dynamoid/associations/belongs_to_spec.rb +0 -71
  105. data/spec/dynamoid/associations/has_and_belongs_to_many_spec.rb +0 -47
  106. data/spec/dynamoid/associations/has_many_spec.rb +0 -42
  107. data/spec/dynamoid/associations/has_one_spec.rb +0 -45
  108. data/spec/dynamoid/associations_spec.rb +0 -16
  109. data/spec/dynamoid/config_spec.rb +0 -27
  110. data/spec/dynamoid/criteria/chain_spec.rb +0 -210
  111. data/spec/dynamoid/criteria_spec.rb +0 -75
  112. data/spec/dynamoid/dirty_spec.rb +0 -57
  113. data/spec/dynamoid/document_spec.rb +0 -180
  114. data/spec/dynamoid/fields_spec.rb +0 -156
  115. data/spec/dynamoid/finders_spec.rb +0 -147
  116. data/spec/dynamoid/identity_map_spec.rb +0 -45
  117. data/spec/dynamoid/indexes/index_spec.rb +0 -104
  118. data/spec/dynamoid/indexes_spec.rb +0 -25
  119. data/spec/dynamoid/persistence_spec.rb +0 -301
  120. data/spec/dynamoid/validations_spec.rb +0 -36
  121. data/spec/dynamoid_spec.rb +0 -9
  122. data/spec/spec_helper.rb +0 -55
  123. data/spec/support/with_partitioning.rb +0 -15
@@ -1,686 +0,0 @@
1
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
- <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4
- <head>
5
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6
- <title>
7
- Module: Dynamoid::Fields
8
-
9
- &mdash; Documentation by YARD 0.8.6.1
10
-
11
- </title>
12
-
13
- <link rel="stylesheet" href="../css/style.css" type="text/css" charset="utf-8" />
14
-
15
- <link rel="stylesheet" href="../css/common.css" type="text/css" charset="utf-8" />
16
-
17
- <script type="text/javascript" charset="utf-8">
18
- hasFrames = window.top.frames.main ? true : false;
19
- relpath = '../';
20
- framesUrl = "../frames.html#!" + escape(window.location.href);
21
- </script>
22
-
23
-
24
- <script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
25
-
26
- <script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
27
-
28
-
29
- </head>
30
- <body>
31
- <div id="header">
32
- <div id="menu">
33
-
34
- <a href="../_index.html">Index (F)</a> &raquo;
35
- <span class='title'><span class='object_link'><a href="../Dynamoid.html" title="Dynamoid (module)">Dynamoid</a></span></span>
36
- &raquo;
37
- <span class="title">Fields</span>
38
-
39
-
40
- <div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
41
- </div>
42
-
43
- <div id="search">
44
-
45
- <a class="full_list_link" id="class_list_link"
46
- href="../class_list.html">
47
- Class List
48
- </a>
49
-
50
- <a class="full_list_link" id="method_list_link"
51
- href="../method_list.html">
52
- Method List
53
- </a>
54
-
55
- <a class="full_list_link" id="file_list_link"
56
- href="../file_list.html">
57
- File List
58
- </a>
59
-
60
- </div>
61
- <div class="clear"></div>
62
- </div>
63
-
64
- <iframe id="search_frame"></iframe>
65
-
66
- <div id="content"><h1>Module: Dynamoid::Fields
67
-
68
-
69
-
70
- </h1>
71
-
72
- <dl class="box">
73
-
74
-
75
-
76
- <dt class="r1">Extended by:</dt>
77
- <dd class="r1">ActiveSupport::Concern</dd>
78
-
79
-
80
-
81
-
82
-
83
-
84
- <dt class="r2">Included in:</dt>
85
- <dd class="r2"><span class='object_link'><a href="Components.html" title="Dynamoid::Components (module)">Components</a></span></dd>
86
-
87
-
88
-
89
- <dt class="r1 last">Defined in:</dt>
90
- <dd class="r1 last">lib/dynamoid/fields.rb</dd>
91
-
92
- </dl>
93
- <div class="clear"></div>
94
-
95
- <h2>Overview</h2><div class="docstring">
96
- <div class="discussion">
97
- <p>All fields on a Dynamoid::Document must be explicitly defined -- if you have fields in the database that are not
98
- specified with field, then they will be ignored.</p>
99
-
100
-
101
- </div>
102
- </div>
103
- <div class="tags">
104
-
105
-
106
- </div><h2>Defined Under Namespace</h2>
107
- <p class="children">
108
-
109
-
110
- <strong class="modules">Modules:</strong> <span class='object_link'><a href="Fields/ClassMethods.html" title="Dynamoid::Fields::ClassMethods (module)">ClassMethods</a></span>
111
-
112
-
113
-
114
-
115
- </p>
116
-
117
-
118
-
119
-
120
- <h2>Instance Attribute Summary <small>(<a href="#" class="summary_toggle">collapse</a>)</small></h2>
121
- <ul class="summary">
122
-
123
- <li class="public ">
124
- <span class="summary_signature">
125
-
126
- <a href="#attributes-instance_method" title="#attributes (instance method)">- (Object) <strong>attributes</strong> </a>
127
-
128
-
129
-
130
- (also: #raw_attributes)
131
-
132
- </span>
133
-
134
-
135
-
136
-
137
-
138
-
139
-
140
-
141
-
142
-
143
-
144
-
145
- <span class="summary_desc"><div class='inline'><p>You can access the attributes of an object directly on its attributes method, which is by default an empty hash.</p>
146
- </div></span>
147
-
148
- </li>
149
-
150
-
151
- </ul>
152
-
153
-
154
-
155
-
156
-
157
- <h2>
158
- Instance Method Summary
159
- <small>(<a href="#" class="summary_toggle">collapse</a>)</small>
160
- </h2>
161
-
162
- <ul class="summary">
163
-
164
- <li class="public ">
165
- <span class="summary_signature">
166
-
167
- <a href="#read_attribute-instance_method" title="#read_attribute (instance method)">- (Object) <strong>read_attribute</strong>(name) </a>
168
-
169
-
170
-
171
- (also: #[])
172
-
173
- </span>
174
-
175
-
176
-
177
-
178
-
179
-
180
-
181
-
182
-
183
- <span class="summary_desc"><div class='inline'><p>Read an attribute from an object.</p>
184
- </div></span>
185
-
186
- </li>
187
-
188
-
189
- <li class="public ">
190
- <span class="summary_signature">
191
-
192
- <a href="#update_attribute-instance_method" title="#update_attribute (instance method)">- (Object) <strong>update_attribute</strong>(attribute, value) </a>
193
-
194
-
195
-
196
- </span>
197
-
198
-
199
-
200
-
201
-
202
-
203
-
204
-
205
-
206
- <span class="summary_desc"><div class='inline'><p>Update a single attribute, saving the object afterwards.</p>
207
- </div></span>
208
-
209
- </li>
210
-
211
-
212
- <li class="public ">
213
- <span class="summary_signature">
214
-
215
- <a href="#update_attributes-instance_method" title="#update_attributes (instance method)">- (Object) <strong>update_attributes</strong>(attributes) </a>
216
-
217
-
218
-
219
- </span>
220
-
221
-
222
-
223
-
224
-
225
-
226
-
227
-
228
-
229
- <span class="summary_desc"><div class='inline'><p>Updates multiple attibutes at once, saving the object once the updates are complete.</p>
230
- </div></span>
231
-
232
- </li>
233
-
234
-
235
- <li class="public ">
236
- <span class="summary_signature">
237
-
238
- <a href="#write_attribute-instance_method" title="#write_attribute (instance method)">- (Object) <strong>write_attribute</strong>(name, value) </a>
239
-
240
-
241
-
242
- (also: #[]=)
243
-
244
- </span>
245
-
246
-
247
-
248
-
249
-
250
-
251
-
252
-
253
-
254
- <span class="summary_desc"><div class='inline'><p>Write an attribute on the object.</p>
255
- </div></span>
256
-
257
- </li>
258
-
259
-
260
- </ul>
261
-
262
-
263
-
264
-
265
- <div id="instance_attr_details" class="attr_details">
266
- <h2>Instance Attribute Details</h2>
267
-
268
-
269
- <span id="attributes=-instance_method"></span>
270
- <div class="method_details first">
271
- <h3 class="signature first" id="attributes-instance_method">
272
-
273
- - (<tt>Object</tt>) <strong>attributes</strong>
274
-
275
-
276
-
277
- <span class="aliases">Also known as:
278
- <span class="names"><span id='raw_attributes-instance_method'>raw_attributes</span></span>
279
- </span>
280
-
281
-
282
-
283
- </h3><div class="docstring">
284
- <div class="discussion">
285
- <p>You can access the attributes of an object directly on its attributes method, which is by default an empty hash.</p>
286
-
287
-
288
- </div>
289
- </div>
290
- <div class="tags">
291
-
292
-
293
- </div><table class="source_code">
294
- <tr>
295
- <td>
296
- <pre class="lines">
297
-
298
-
299
- 63
300
- 64
301
- 65</pre>
302
- </td>
303
- <td>
304
- <pre class="code"><span class="info file"># File 'lib/dynamoid/fields.rb', line 63</span>
305
-
306
- <span class='kw'>def</span> <span class='id identifier rubyid_attributes'>attributes</span>
307
- <span class='ivar'>@attributes</span>
308
- <span class='kw'>end</span></pre>
309
- </td>
310
- </tr>
311
- </table>
312
- </div>
313
-
314
- </div>
315
-
316
-
317
- <div id="instance_method_details" class="method_details_list">
318
- <h2>Instance Method Details</h2>
319
-
320
-
321
- <div class="method_details first">
322
- <h3 class="signature first" id="read_attribute-instance_method">
323
-
324
- - (<tt>Object</tt>) <strong>read_attribute</strong>(name)
325
-
326
-
327
-
328
- <span class="aliases">Also known as:
329
- <span class="names"><span id='[]-instance_method'>[]</span></span>
330
- </span>
331
-
332
-
333
-
334
- </h3><div class="docstring">
335
- <div class="discussion">
336
- <p>Read an attribute from an object.</p>
337
-
338
-
339
- </div>
340
- </div>
341
- <div class="tags">
342
- <p class="tag_title">Parameters:</p>
343
- <ul class="param">
344
-
345
- <li>
346
-
347
- <span class='name'>name</span>
348
-
349
-
350
- <span class='type'>(<tt>Symbol</tt>)</span>
351
-
352
-
353
-
354
- &mdash;
355
- <div class='inline'><p>the name of the field</p>
356
- </div>
357
-
358
- </li>
359
-
360
- </ul>
361
-
362
- <p class="tag_title">Since:</p>
363
- <ul class="since">
364
-
365
- <li>
366
-
367
-
368
-
369
-
370
-
371
- <div class='inline'><p>0.2.0</p>
372
- </div>
373
-
374
- </li>
375
-
376
- </ul>
377
-
378
- </div><table class="source_code">
379
- <tr>
380
- <td>
381
- <pre class="lines">
382
-
383
-
384
- 90
385
- 91
386
- 92</pre>
387
- </td>
388
- <td>
389
- <pre class="code"><span class="info file"># File 'lib/dynamoid/fields.rb', line 90</span>
390
-
391
- <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>
392
- <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>
393
- <span class='kw'>end</span></pre>
394
- </td>
395
- </tr>
396
- </table>
397
- </div>
398
-
399
- <div class="method_details ">
400
- <h3 class="signature " id="update_attribute-instance_method">
401
-
402
- - (<tt>Object</tt>) <strong>update_attribute</strong>(attribute, value)
403
-
404
-
405
-
406
-
407
-
408
- </h3><div class="docstring">
409
- <div class="discussion">
410
- <p>Update a single attribute, saving the object afterwards.</p>
411
-
412
-
413
- </div>
414
- </div>
415
- <div class="tags">
416
- <p class="tag_title">Parameters:</p>
417
- <ul class="param">
418
-
419
- <li>
420
-
421
- <span class='name'>attribute</span>
422
-
423
-
424
- <span class='type'>(<tt>Symbol</tt>)</span>
425
-
426
-
427
-
428
- &mdash;
429
- <div class='inline'><p>the attribute to update</p>
430
- </div>
431
-
432
- </li>
433
-
434
- <li>
435
-
436
- <span class='name'>value</span>
437
-
438
-
439
- <span class='type'>(<tt>Object</tt>)</span>
440
-
441
-
442
-
443
- &mdash;
444
- <div class='inline'><p>the value to assign it</p>
445
- </div>
446
-
447
- </li>
448
-
449
- </ul>
450
-
451
- <p class="tag_title">Since:</p>
452
- <ul class="since">
453
-
454
- <li>
455
-
456
-
457
-
458
-
459
-
460
- <div class='inline'><p>0.2.0</p>
461
- </div>
462
-
463
- </li>
464
-
465
- </ul>
466
-
467
- </div><table class="source_code">
468
- <tr>
469
- <td>
470
- <pre class="lines">
471
-
472
-
473
- 111
474
- 112
475
- 113
476
- 114</pre>
477
- </td>
478
- <td>
479
- <pre class="code"><span class="info file"># File 'lib/dynamoid/fields.rb', line 111</span>
480
-
481
- <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>
482
- <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>
483
- <span class='id identifier rubyid_save'>save</span>
484
- <span class='kw'>end</span></pre>
485
- </td>
486
- </tr>
487
- </table>
488
- </div>
489
-
490
- <div class="method_details ">
491
- <h3 class="signature " id="update_attributes-instance_method">
492
-
493
- - (<tt>Object</tt>) <strong>update_attributes</strong>(attributes)
494
-
495
-
496
-
497
-
498
-
499
- </h3><div class="docstring">
500
- <div class="discussion">
501
- <p>Updates multiple attibutes at once, saving the object once the updates are complete.</p>
502
-
503
-
504
- </div>
505
- </div>
506
- <div class="tags">
507
- <p class="tag_title">Parameters:</p>
508
- <ul class="param">
509
-
510
- <li>
511
-
512
- <span class='name'>attributes</span>
513
-
514
-
515
- <span class='type'>(<tt>Hash</tt>)</span>
516
-
517
-
518
-
519
- &mdash;
520
- <div class='inline'><p>a hash of attributes to update</p>
521
- </div>
522
-
523
- </li>
524
-
525
- </ul>
526
-
527
- <p class="tag_title">Since:</p>
528
- <ul class="since">
529
-
530
- <li>
531
-
532
-
533
-
534
-
535
-
536
- <div class='inline'><p>0.2.0</p>
537
- </div>
538
-
539
- </li>
540
-
541
- </ul>
542
-
543
- </div><table class="source_code">
544
- <tr>
545
- <td>
546
- <pre class="lines">
547
-
548
-
549
- 100
550
- 101
551
- 102
552
- 103</pre>
553
- </td>
554
- <td>
555
- <pre class="code"><span class="info file"># File 'lib/dynamoid/fields.rb', line 100</span>
556
-
557
- <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>
558
- <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> <span class='kw'>unless</span> <span class='id identifier rubyid_attributes'>attributes</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span> <span class='op'>||</span> <span class='id identifier rubyid_attributes'>attributes</span><span class='period'>.</span><span class='id identifier rubyid_empty?'>empty?</span>
559
- <span class='id identifier rubyid_save'>save</span>
560
- <span class='kw'>end</span></pre>
561
- </td>
562
- </tr>
563
- </table>
564
- </div>
565
-
566
- <div class="method_details ">
567
- <h3 class="signature " id="write_attribute-instance_method">
568
-
569
- - (<tt>Object</tt>) <strong>write_attribute</strong>(name, value)
570
-
571
-
572
-
573
- <span class="aliases">Also known as:
574
- <span class="names"><span id='[]=-instance_method'>[]=</span></span>
575
- </span>
576
-
577
-
578
-
579
- </h3><div class="docstring">
580
- <div class="discussion">
581
- <p>Write an attribute on the object. Also marks the previous value as dirty.</p>
582
-
583
-
584
- </div>
585
- </div>
586
- <div class="tags">
587
- <p class="tag_title">Parameters:</p>
588
- <ul class="param">
589
-
590
- <li>
591
-
592
- <span class='name'>name</span>
593
-
594
-
595
- <span class='type'>(<tt>Symbol</tt>)</span>
596
-
597
-
598
-
599
- &mdash;
600
- <div class='inline'><p>the name of the field</p>
601
- </div>
602
-
603
- </li>
604
-
605
- <li>
606
-
607
- <span class='name'>value</span>
608
-
609
-
610
- <span class='type'>(<tt>Object</tt>)</span>
611
-
612
-
613
-
614
- &mdash;
615
- <div class='inline'><p>the value to assign to that field</p>
616
- </div>
617
-
618
- </li>
619
-
620
- </ul>
621
-
622
- <p class="tag_title">Since:</p>
623
- <ul class="since">
624
-
625
- <li>
626
-
627
-
628
-
629
-
630
-
631
- <div class='inline'><p>0.2.0</p>
632
- </div>
633
-
634
- </li>
635
-
636
- </ul>
637
-
638
- </div><table class="source_code">
639
- <tr>
640
- <td>
641
- <pre class="lines">
642
-
643
-
644
- 72
645
- 73
646
- 74
647
- 75
648
- 76
649
- 77
650
- 78
651
- 79
652
- 80
653
- 81
654
- 82</pre>
655
- </td>
656
- <td>
657
- <pre class="code"><span class="info file"># File 'lib/dynamoid/fields.rb', line 72</span>
658
-
659
- <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>
660
- <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'>&gt;</span> <span class='const'>MAX_ITEM_SIZE</span>
661
- <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'>&quot;</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'>&quot;</span></span>
662
- <span class='kw'>end</span>
663
-
664
- <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>
665
- <span class='id identifier rubyid_association'>association</span><span class='period'>.</span><span class='id identifier rubyid_reset'>reset</span>
666
- <span class='kw'>end</span>
667
-
668
- <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>
669
- <span class='kw'>end</span></pre>
670
- </td>
671
- </tr>
672
- </table>
673
- </div>
674
-
675
- </div>
676
-
677
- </div>
678
-
679
- <div id="footer">
680
- Generated on Thu Jun 27 21:59:09 2013 by
681
- <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
682
- 0.8.6.1 (ruby-1.9.3).
683
- </div>
684
-
685
- </body>
686
- </html>