adept_dynamoid 0.5.0.6
Sign up to get free protection for your applications and to get access to all the features.
- data/.document +5 -0
- data/.rspec +1 -0
- data/Dynamoid.gemspec +193 -0
- data/Gemfile +23 -0
- data/Gemfile.lock +86 -0
- data/LICENSE.txt +20 -0
- data/README.markdown +265 -0
- data/Rakefile +62 -0
- data/VERSION +1 -0
- data/doc/.nojekyll +0 -0
- data/doc/Dynamoid.html +312 -0
- data/doc/Dynamoid/Adapter.html +1385 -0
- data/doc/Dynamoid/Adapter/AwsSdk.html +1585 -0
- data/doc/Dynamoid/Adapter/Local.html +1574 -0
- data/doc/Dynamoid/Associations.html +131 -0
- data/doc/Dynamoid/Associations/Association.html +794 -0
- data/doc/Dynamoid/Associations/BelongsTo.html +158 -0
- data/doc/Dynamoid/Associations/ClassMethods.html +723 -0
- data/doc/Dynamoid/Associations/HasAndBelongsToMany.html +164 -0
- data/doc/Dynamoid/Associations/HasMany.html +164 -0
- data/doc/Dynamoid/Associations/HasOne.html +158 -0
- data/doc/Dynamoid/Associations/ManyAssociation.html +1640 -0
- data/doc/Dynamoid/Associations/SingleAssociation.html +598 -0
- data/doc/Dynamoid/Components.html +204 -0
- data/doc/Dynamoid/Config.html +395 -0
- data/doc/Dynamoid/Config/Options.html +609 -0
- data/doc/Dynamoid/Criteria.html +131 -0
- data/doc/Dynamoid/Criteria/Chain.html +1063 -0
- data/doc/Dynamoid/Criteria/ClassMethods.html +98 -0
- data/doc/Dynamoid/Document.html +666 -0
- data/doc/Dynamoid/Document/ClassMethods.html +937 -0
- data/doc/Dynamoid/Errors.html +118 -0
- data/doc/Dynamoid/Errors/DocumentNotValid.html +210 -0
- data/doc/Dynamoid/Errors/Error.html +130 -0
- data/doc/Dynamoid/Errors/InvalidField.html +133 -0
- data/doc/Dynamoid/Errors/MissingRangeKey.html +133 -0
- data/doc/Dynamoid/Fields.html +669 -0
- data/doc/Dynamoid/Fields/ClassMethods.html +309 -0
- data/doc/Dynamoid/Finders.html +128 -0
- data/doc/Dynamoid/Finders/ClassMethods.html +516 -0
- data/doc/Dynamoid/Indexes.html +308 -0
- data/doc/Dynamoid/Indexes/ClassMethods.html +353 -0
- data/doc/Dynamoid/Indexes/Index.html +1104 -0
- data/doc/Dynamoid/Persistence.html +651 -0
- data/doc/Dynamoid/Persistence/ClassMethods.html +670 -0
- data/doc/Dynamoid/Validations.html +399 -0
- data/doc/_index.html +461 -0
- data/doc/class_list.html +47 -0
- data/doc/css/common.css +1 -0
- data/doc/css/full_list.css +55 -0
- data/doc/css/style.css +322 -0
- data/doc/file.LICENSE.html +66 -0
- data/doc/file.README.html +312 -0
- data/doc/file_list.html +52 -0
- data/doc/frames.html +13 -0
- data/doc/index.html +312 -0
- data/doc/js/app.js +205 -0
- data/doc/js/full_list.js +173 -0
- data/doc/js/jquery.js +16 -0
- data/doc/method_list.html +1238 -0
- data/doc/top-level-namespace.html +105 -0
- data/lib/dynamoid.rb +47 -0
- data/lib/dynamoid/adapter.rb +177 -0
- data/lib/dynamoid/adapter/aws_sdk.rb +223 -0
- data/lib/dynamoid/associations.rb +106 -0
- data/lib/dynamoid/associations/association.rb +105 -0
- data/lib/dynamoid/associations/belongs_to.rb +44 -0
- data/lib/dynamoid/associations/has_and_belongs_to_many.rb +40 -0
- data/lib/dynamoid/associations/has_many.rb +39 -0
- data/lib/dynamoid/associations/has_one.rb +39 -0
- data/lib/dynamoid/associations/many_association.rb +191 -0
- data/lib/dynamoid/associations/single_association.rb +69 -0
- data/lib/dynamoid/components.rb +36 -0
- data/lib/dynamoid/config.rb +57 -0
- data/lib/dynamoid/config/options.rb +78 -0
- data/lib/dynamoid/criteria.rb +29 -0
- data/lib/dynamoid/criteria/chain.rb +243 -0
- data/lib/dynamoid/dirty.rb +41 -0
- data/lib/dynamoid/document.rb +184 -0
- data/lib/dynamoid/errors.rb +28 -0
- data/lib/dynamoid/fields.rb +130 -0
- data/lib/dynamoid/finders.rb +131 -0
- data/lib/dynamoid/identity_map.rb +96 -0
- data/lib/dynamoid/indexes.rb +69 -0
- data/lib/dynamoid/indexes/index.rb +103 -0
- data/lib/dynamoid/middleware/identity_map.rb +16 -0
- data/lib/dynamoid/persistence.rb +247 -0
- data/lib/dynamoid/validations.rb +36 -0
- data/spec/app/models/address.rb +10 -0
- data/spec/app/models/camel_case.rb +24 -0
- data/spec/app/models/magazine.rb +11 -0
- data/spec/app/models/message.rb +9 -0
- data/spec/app/models/sponsor.rb +8 -0
- data/spec/app/models/subscription.rb +12 -0
- data/spec/app/models/tweet.rb +12 -0
- data/spec/app/models/user.rb +26 -0
- data/spec/dynamoid/adapter/aws_sdk_spec.rb +186 -0
- data/spec/dynamoid/adapter_spec.rb +117 -0
- data/spec/dynamoid/associations/association_spec.rb +194 -0
- data/spec/dynamoid/associations/belongs_to_spec.rb +71 -0
- data/spec/dynamoid/associations/has_and_belongs_to_many_spec.rb +47 -0
- data/spec/dynamoid/associations/has_many_spec.rb +42 -0
- data/spec/dynamoid/associations/has_one_spec.rb +45 -0
- data/spec/dynamoid/associations_spec.rb +16 -0
- data/spec/dynamoid/config_spec.rb +27 -0
- data/spec/dynamoid/criteria/chain_spec.rb +140 -0
- data/spec/dynamoid/criteria_spec.rb +72 -0
- data/spec/dynamoid/dirty_spec.rb +49 -0
- data/spec/dynamoid/document_spec.rb +118 -0
- data/spec/dynamoid/fields_spec.rb +127 -0
- data/spec/dynamoid/finders_spec.rb +135 -0
- data/spec/dynamoid/identity_map_spec.rb +45 -0
- data/spec/dynamoid/indexes/index_spec.rb +104 -0
- data/spec/dynamoid/indexes_spec.rb +25 -0
- data/spec/dynamoid/persistence_spec.rb +176 -0
- data/spec/dynamoid/validations_spec.rb +36 -0
- data/spec/dynamoid_spec.rb +9 -0
- data/spec/spec_helper.rb +50 -0
- metadata +376 -0
@@ -0,0 +1,937 @@
|
|
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::Document::ClassMethods
|
8
|
+
|
9
|
+
— Documentation by YARD 0.7.5
|
10
|
+
|
11
|
+
</title>
|
12
|
+
|
13
|
+
<link rel="stylesheet" href="../../css/style.css" type="text/css" media="screen" charset="utf-8" />
|
14
|
+
|
15
|
+
<link rel="stylesheet" href="../../css/common.css" type="text/css" media="screen" charset="utf-8" />
|
16
|
+
|
17
|
+
<script type="text/javascript" charset="utf-8">
|
18
|
+
relpath = '../..';
|
19
|
+
if (relpath != '') relpath += '/';
|
20
|
+
</script>
|
21
|
+
|
22
|
+
<script type="text/javascript" charset="utf-8" src="../../js/jquery.js"></script>
|
23
|
+
|
24
|
+
<script type="text/javascript" charset="utf-8" src="../../js/app.js"></script>
|
25
|
+
|
26
|
+
|
27
|
+
</head>
|
28
|
+
<body>
|
29
|
+
<script type="text/javascript" charset="utf-8">
|
30
|
+
if (window.top.frames.main) document.body.className = 'frames';
|
31
|
+
</script>
|
32
|
+
|
33
|
+
<div id="header">
|
34
|
+
<div id="menu">
|
35
|
+
|
36
|
+
<a href="../../_index.html">Index (C)</a> »
|
37
|
+
<span class='title'><span class='object_link'><a href="../../Dynamoid.html" title="Dynamoid (module)">Dynamoid</a></span></span> » <span class='title'><span class='object_link'><a href="../Document.html" title="Dynamoid::Document (module)">Document</a></span></span>
|
38
|
+
»
|
39
|
+
<span class="title">ClassMethods</span>
|
40
|
+
|
41
|
+
|
42
|
+
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
43
|
+
</div>
|
44
|
+
|
45
|
+
<div id="search">
|
46
|
+
|
47
|
+
<a id="class_list_link" href="#">Class List</a>
|
48
|
+
|
49
|
+
<a id="method_list_link" href="#">Method List</a>
|
50
|
+
|
51
|
+
<a id="file_list_link" href="#">File List</a>
|
52
|
+
|
53
|
+
</div>
|
54
|
+
<div class="clear"></div>
|
55
|
+
</div>
|
56
|
+
|
57
|
+
<iframe id="search_frame"></iframe>
|
58
|
+
|
59
|
+
<div id="content"><h1>Module: Dynamoid::Document::ClassMethods
|
60
|
+
|
61
|
+
|
62
|
+
|
63
|
+
</h1>
|
64
|
+
|
65
|
+
<dl class="box">
|
66
|
+
|
67
|
+
|
68
|
+
|
69
|
+
|
70
|
+
|
71
|
+
|
72
|
+
|
73
|
+
|
74
|
+
<dt class="r1 last">Defined in:</dt>
|
75
|
+
<dd class="r1 last">lib/dynamoid/document.rb</dd>
|
76
|
+
|
77
|
+
</dl>
|
78
|
+
<div class="clear"></div>
|
79
|
+
|
80
|
+
|
81
|
+
|
82
|
+
|
83
|
+
|
84
|
+
|
85
|
+
|
86
|
+
|
87
|
+
|
88
|
+
<h2>
|
89
|
+
Instance Method Summary
|
90
|
+
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
|
91
|
+
</h2>
|
92
|
+
|
93
|
+
<ul class="summary">
|
94
|
+
|
95
|
+
<li class="public ">
|
96
|
+
<span class="summary_signature">
|
97
|
+
|
98
|
+
<a href="#build-instance_method" title="#build (instance method)">- (Dynamoid::Document) <strong>build</strong>(attrs = {}) </a>
|
99
|
+
|
100
|
+
|
101
|
+
|
102
|
+
</span>
|
103
|
+
|
104
|
+
|
105
|
+
|
106
|
+
|
107
|
+
|
108
|
+
|
109
|
+
|
110
|
+
|
111
|
+
<span class="summary_desc"><div class='inline'><p>Initialize a new object.</p>
|
112
|
+
</div></span>
|
113
|
+
|
114
|
+
</li>
|
115
|
+
|
116
|
+
|
117
|
+
<li class="public ">
|
118
|
+
<span class="summary_signature">
|
119
|
+
|
120
|
+
<a href="#create-instance_method" title="#create (instance method)">- (Dynamoid::Document) <strong>create</strong>(attrs = {}) </a>
|
121
|
+
|
122
|
+
|
123
|
+
|
124
|
+
</span>
|
125
|
+
|
126
|
+
|
127
|
+
|
128
|
+
|
129
|
+
|
130
|
+
|
131
|
+
|
132
|
+
|
133
|
+
<span class="summary_desc"><div class='inline'><p>Initialize a new object and immediately save it to the database.</p>
|
134
|
+
</div></span>
|
135
|
+
|
136
|
+
</li>
|
137
|
+
|
138
|
+
|
139
|
+
<li class="public ">
|
140
|
+
<span class="summary_signature">
|
141
|
+
|
142
|
+
<a href="#create%21-instance_method" title="#create! (instance method)">- (Dynamoid::Document) <strong>create!</strong>(attrs = {}) </a>
|
143
|
+
|
144
|
+
|
145
|
+
|
146
|
+
</span>
|
147
|
+
|
148
|
+
|
149
|
+
|
150
|
+
|
151
|
+
|
152
|
+
|
153
|
+
|
154
|
+
|
155
|
+
<span class="summary_desc"><div class='inline'><p>Initialize a new object and immediately save it to the database.</p>
|
156
|
+
</div></span>
|
157
|
+
|
158
|
+
</li>
|
159
|
+
|
160
|
+
|
161
|
+
<li class="public ">
|
162
|
+
<span class="summary_signature">
|
163
|
+
|
164
|
+
<a href="#exists%3F-instance_method" title="#exists? (instance method)">- (Boolean) <strong>exists?</strong>(id) </a>
|
165
|
+
|
166
|
+
|
167
|
+
|
168
|
+
</span>
|
169
|
+
|
170
|
+
|
171
|
+
|
172
|
+
|
173
|
+
|
174
|
+
|
175
|
+
|
176
|
+
|
177
|
+
<span class="summary_desc"><div class='inline'><p>Does this object exist?.</p>
|
178
|
+
</div></span>
|
179
|
+
|
180
|
+
</li>
|
181
|
+
|
182
|
+
|
183
|
+
<li class="public ">
|
184
|
+
<span class="summary_signature">
|
185
|
+
|
186
|
+
<a href="#hash_key-instance_method" title="#hash_key (instance method)">- (Object) <strong>hash_key</strong> </a>
|
187
|
+
|
188
|
+
|
189
|
+
|
190
|
+
</span>
|
191
|
+
|
192
|
+
|
193
|
+
|
194
|
+
|
195
|
+
|
196
|
+
|
197
|
+
|
198
|
+
|
199
|
+
<span class="summary_desc"><div class='inline'><p>Returns the id field for this class.</p>
|
200
|
+
</div></span>
|
201
|
+
|
202
|
+
</li>
|
203
|
+
|
204
|
+
|
205
|
+
<li class="public ">
|
206
|
+
<span class="summary_signature">
|
207
|
+
|
208
|
+
<a href="#read_capacity-instance_method" title="#read_capacity (instance method)">- (Object) <strong>read_capacity</strong> </a>
|
209
|
+
|
210
|
+
|
211
|
+
|
212
|
+
</span>
|
213
|
+
|
214
|
+
|
215
|
+
|
216
|
+
|
217
|
+
|
218
|
+
|
219
|
+
|
220
|
+
|
221
|
+
<span class="summary_desc"><div class='inline'><p>Returns the read_capacity for this table.</p>
|
222
|
+
</div></span>
|
223
|
+
|
224
|
+
</li>
|
225
|
+
|
226
|
+
|
227
|
+
<li class="public ">
|
228
|
+
<span class="summary_signature">
|
229
|
+
|
230
|
+
<a href="#table-instance_method" title="#table (instance method)">- (Object) <strong>table</strong>(options = {}) </a>
|
231
|
+
|
232
|
+
|
233
|
+
|
234
|
+
</span>
|
235
|
+
|
236
|
+
|
237
|
+
|
238
|
+
|
239
|
+
|
240
|
+
|
241
|
+
|
242
|
+
|
243
|
+
<span class="summary_desc"><div class='inline'><p>Set up table options, including naming it whatever you want, setting the id key, and manually overriding read and
|
244
|
+
write capacity.</p>
|
245
|
+
</div></span>
|
246
|
+
|
247
|
+
</li>
|
248
|
+
|
249
|
+
|
250
|
+
<li class="public ">
|
251
|
+
<span class="summary_signature">
|
252
|
+
|
253
|
+
<a href="#write_capacity-instance_method" title="#write_capacity (instance method)">- (Object) <strong>write_capacity</strong> </a>
|
254
|
+
|
255
|
+
|
256
|
+
|
257
|
+
</span>
|
258
|
+
|
259
|
+
|
260
|
+
|
261
|
+
|
262
|
+
|
263
|
+
|
264
|
+
|
265
|
+
|
266
|
+
<span class="summary_desc"><div class='inline'><p>Returns the write_capacity for this table.</p>
|
267
|
+
</div></span>
|
268
|
+
|
269
|
+
</li>
|
270
|
+
|
271
|
+
|
272
|
+
</ul>
|
273
|
+
|
274
|
+
|
275
|
+
|
276
|
+
|
277
|
+
<div id="instance_method_details" class="method_details_list">
|
278
|
+
<h2>Instance Method Details</h2>
|
279
|
+
|
280
|
+
|
281
|
+
<div class="method_details first">
|
282
|
+
<p class="signature first" id="build-instance_method">
|
283
|
+
|
284
|
+
- (<tt><span class='object_link'><a href="../Document.html" title="Dynamoid::Document (module)">Dynamoid::Document</a></span></tt>) <strong>build</strong>(attrs = {})
|
285
|
+
|
286
|
+
|
287
|
+
|
288
|
+
</p><div class="docstring">
|
289
|
+
<div class="discussion">
|
290
|
+
<p>Initialize a new object.</p>
|
291
|
+
|
292
|
+
|
293
|
+
</div>
|
294
|
+
</div>
|
295
|
+
<div class="tags">
|
296
|
+
<h3>Parameters:</h3>
|
297
|
+
<ul class="param">
|
298
|
+
|
299
|
+
<li>
|
300
|
+
|
301
|
+
<span class='name'>attrs</span>
|
302
|
+
|
303
|
+
|
304
|
+
<span class='type'>(<tt>Hash</tt>)</span>
|
305
|
+
|
306
|
+
|
307
|
+
<em class="default">(defaults to: <tt>{}</tt>)</em>
|
308
|
+
|
309
|
+
|
310
|
+
—
|
311
|
+
<div class='inline'><p>Attributes with which to create the object.</p>
|
312
|
+
</div>
|
313
|
+
|
314
|
+
</li>
|
315
|
+
|
316
|
+
</ul>
|
317
|
+
|
318
|
+
<h3>Returns:</h3>
|
319
|
+
<ul class="return">
|
320
|
+
|
321
|
+
<li>
|
322
|
+
|
323
|
+
|
324
|
+
<span class='type'>(<tt><span class='object_link'><a href="../Document.html" title="Dynamoid::Document (module)">Dynamoid::Document</a></span></tt>)</span>
|
325
|
+
|
326
|
+
|
327
|
+
|
328
|
+
—
|
329
|
+
<div class='inline'><p>the new document</p>
|
330
|
+
</div>
|
331
|
+
|
332
|
+
</li>
|
333
|
+
|
334
|
+
</ul>
|
335
|
+
<h3>Since:</h3>
|
336
|
+
<ul class="since">
|
337
|
+
|
338
|
+
<li>
|
339
|
+
|
340
|
+
|
341
|
+
|
342
|
+
|
343
|
+
|
344
|
+
<div class='inline'><p>0.2.0</p>
|
345
|
+
</div>
|
346
|
+
|
347
|
+
</li>
|
348
|
+
|
349
|
+
</ul>
|
350
|
+
|
351
|
+
</div><table class="source_code">
|
352
|
+
<tr>
|
353
|
+
<td>
|
354
|
+
<pre class="lines">
|
355
|
+
|
356
|
+
|
357
|
+
82
|
358
|
+
83
|
359
|
+
84</pre>
|
360
|
+
</td>
|
361
|
+
<td>
|
362
|
+
<pre class="code"><span class="info file"># File 'lib/dynamoid/document.rb', line 82</span>
|
363
|
+
|
364
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_build'>build</span><span class='lparen'>(</span><span class='id identifier rubyid_attrs'>attrs</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
|
365
|
+
<span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_attrs'>attrs</span><span class='rparen'>)</span>
|
366
|
+
<span class='kw'>end</span></pre>
|
367
|
+
</td>
|
368
|
+
</tr>
|
369
|
+
</table>
|
370
|
+
</div>
|
371
|
+
|
372
|
+
<div class="method_details ">
|
373
|
+
<p class="signature " id="create-instance_method">
|
374
|
+
|
375
|
+
- (<tt><span class='object_link'><a href="../Document.html" title="Dynamoid::Document (module)">Dynamoid::Document</a></span></tt>) <strong>create</strong>(attrs = {})
|
376
|
+
|
377
|
+
|
378
|
+
|
379
|
+
</p><div class="docstring">
|
380
|
+
<div class="discussion">
|
381
|
+
<p>Initialize a new object and immediately save it to the database.</p>
|
382
|
+
|
383
|
+
|
384
|
+
</div>
|
385
|
+
</div>
|
386
|
+
<div class="tags">
|
387
|
+
<h3>Parameters:</h3>
|
388
|
+
<ul class="param">
|
389
|
+
|
390
|
+
<li>
|
391
|
+
|
392
|
+
<span class='name'>attrs</span>
|
393
|
+
|
394
|
+
|
395
|
+
<span class='type'>(<tt>Hash</tt>)</span>
|
396
|
+
|
397
|
+
|
398
|
+
<em class="default">(defaults to: <tt>{}</tt>)</em>
|
399
|
+
|
400
|
+
|
401
|
+
—
|
402
|
+
<div class='inline'><p>Attributes with which to create the object.</p>
|
403
|
+
</div>
|
404
|
+
|
405
|
+
</li>
|
406
|
+
|
407
|
+
</ul>
|
408
|
+
|
409
|
+
<h3>Returns:</h3>
|
410
|
+
<ul class="return">
|
411
|
+
|
412
|
+
<li>
|
413
|
+
|
414
|
+
|
415
|
+
<span class='type'>(<tt><span class='object_link'><a href="../Document.html" title="Dynamoid::Document (module)">Dynamoid::Document</a></span></tt>)</span>
|
416
|
+
|
417
|
+
|
418
|
+
|
419
|
+
—
|
420
|
+
<div class='inline'><p>the saved document</p>
|
421
|
+
</div>
|
422
|
+
|
423
|
+
</li>
|
424
|
+
|
425
|
+
</ul>
|
426
|
+
<h3>Since:</h3>
|
427
|
+
<ul class="since">
|
428
|
+
|
429
|
+
<li>
|
430
|
+
|
431
|
+
|
432
|
+
|
433
|
+
|
434
|
+
|
435
|
+
<div class='inline'><p>0.2.0</p>
|
436
|
+
</div>
|
437
|
+
|
438
|
+
</li>
|
439
|
+
|
440
|
+
</ul>
|
441
|
+
|
442
|
+
</div><table class="source_code">
|
443
|
+
<tr>
|
444
|
+
<td>
|
445
|
+
<pre class="lines">
|
446
|
+
|
447
|
+
|
448
|
+
60
|
449
|
+
61
|
450
|
+
62</pre>
|
451
|
+
</td>
|
452
|
+
<td>
|
453
|
+
<pre class="code"><span class="info file"># File 'lib/dynamoid/document.rb', line 60</span>
|
454
|
+
|
455
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_create'>create</span><span class='lparen'>(</span><span class='id identifier rubyid_attrs'>attrs</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
|
456
|
+
<span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_attrs'>attrs</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_tap'>tap</span><span class='lparen'>(</span><span class='op'>&</span><span class='symbol'>:save</span><span class='rparen'>)</span>
|
457
|
+
<span class='kw'>end</span></pre>
|
458
|
+
</td>
|
459
|
+
</tr>
|
460
|
+
</table>
|
461
|
+
</div>
|
462
|
+
|
463
|
+
<div class="method_details ">
|
464
|
+
<p class="signature " id="create!-instance_method">
|
465
|
+
|
466
|
+
- (<tt><span class='object_link'><a href="../Document.html" title="Dynamoid::Document (module)">Dynamoid::Document</a></span></tt>) <strong>create!</strong>(attrs = {})
|
467
|
+
|
468
|
+
|
469
|
+
|
470
|
+
</p><div class="docstring">
|
471
|
+
<div class="discussion">
|
472
|
+
<p>Initialize a new object and immediately save it to the database. Raise an exception if persistence failed.</p>
|
473
|
+
|
474
|
+
|
475
|
+
</div>
|
476
|
+
</div>
|
477
|
+
<div class="tags">
|
478
|
+
<h3>Parameters:</h3>
|
479
|
+
<ul class="param">
|
480
|
+
|
481
|
+
<li>
|
482
|
+
|
483
|
+
<span class='name'>attrs</span>
|
484
|
+
|
485
|
+
|
486
|
+
<span class='type'>(<tt>Hash</tt>)</span>
|
487
|
+
|
488
|
+
|
489
|
+
<em class="default">(defaults to: <tt>{}</tt>)</em>
|
490
|
+
|
491
|
+
|
492
|
+
—
|
493
|
+
<div class='inline'><p>Attributes with which to create the object.</p>
|
494
|
+
</div>
|
495
|
+
|
496
|
+
</li>
|
497
|
+
|
498
|
+
</ul>
|
499
|
+
|
500
|
+
<h3>Returns:</h3>
|
501
|
+
<ul class="return">
|
502
|
+
|
503
|
+
<li>
|
504
|
+
|
505
|
+
|
506
|
+
<span class='type'>(<tt><span class='object_link'><a href="../Document.html" title="Dynamoid::Document (module)">Dynamoid::Document</a></span></tt>)</span>
|
507
|
+
|
508
|
+
|
509
|
+
|
510
|
+
—
|
511
|
+
<div class='inline'><p>the saved document</p>
|
512
|
+
</div>
|
513
|
+
|
514
|
+
</li>
|
515
|
+
|
516
|
+
</ul>
|
517
|
+
<h3>Since:</h3>
|
518
|
+
<ul class="since">
|
519
|
+
|
520
|
+
<li>
|
521
|
+
|
522
|
+
|
523
|
+
|
524
|
+
|
525
|
+
|
526
|
+
<div class='inline'><p>0.2.0</p>
|
527
|
+
</div>
|
528
|
+
|
529
|
+
</li>
|
530
|
+
|
531
|
+
</ul>
|
532
|
+
|
533
|
+
</div><table class="source_code">
|
534
|
+
<tr>
|
535
|
+
<td>
|
536
|
+
<pre class="lines">
|
537
|
+
|
538
|
+
|
539
|
+
71
|
540
|
+
72
|
541
|
+
73</pre>
|
542
|
+
</td>
|
543
|
+
<td>
|
544
|
+
<pre class="code"><span class="info file"># File 'lib/dynamoid/document.rb', line 71</span>
|
545
|
+
|
546
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_create!'>create!</span><span class='lparen'>(</span><span class='id identifier rubyid_attrs'>attrs</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
|
547
|
+
<span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_attrs'>attrs</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_tap'>tap</span><span class='lparen'>(</span><span class='op'>&</span><span class='symbol'>:save!</span><span class='rparen'>)</span>
|
548
|
+
<span class='kw'>end</span></pre>
|
549
|
+
</td>
|
550
|
+
</tr>
|
551
|
+
</table>
|
552
|
+
</div>
|
553
|
+
|
554
|
+
<div class="method_details ">
|
555
|
+
<p class="signature " id="exists?-instance_method">
|
556
|
+
|
557
|
+
- (<tt>Boolean</tt>) <strong>exists?</strong>(id)
|
558
|
+
|
559
|
+
|
560
|
+
|
561
|
+
</p><div class="docstring">
|
562
|
+
<div class="discussion">
|
563
|
+
<p>Does this object exist?</p>
|
564
|
+
|
565
|
+
|
566
|
+
</div>
|
567
|
+
</div>
|
568
|
+
<div class="tags">
|
569
|
+
<h3>Parameters:</h3>
|
570
|
+
<ul class="param">
|
571
|
+
|
572
|
+
<li>
|
573
|
+
|
574
|
+
<span class='name'>id</span>
|
575
|
+
|
576
|
+
|
577
|
+
<span class='type'>(<tt>String</tt>)</span>
|
578
|
+
|
579
|
+
|
580
|
+
|
581
|
+
—
|
582
|
+
<div class='inline'><p>the id of the object</p>
|
583
|
+
</div>
|
584
|
+
|
585
|
+
</li>
|
586
|
+
|
587
|
+
</ul>
|
588
|
+
|
589
|
+
<h3>Returns:</h3>
|
590
|
+
<ul class="return">
|
591
|
+
|
592
|
+
<li>
|
593
|
+
|
594
|
+
|
595
|
+
<span class='type'>(<tt>Boolean</tt>)</span>
|
596
|
+
|
597
|
+
|
598
|
+
|
599
|
+
—
|
600
|
+
<div class='inline'><p>true/false</p>
|
601
|
+
</div>
|
602
|
+
|
603
|
+
</li>
|
604
|
+
|
605
|
+
</ul>
|
606
|
+
<h3>Since:</h3>
|
607
|
+
<ul class="since">
|
608
|
+
|
609
|
+
<li>
|
610
|
+
|
611
|
+
|
612
|
+
|
613
|
+
|
614
|
+
|
615
|
+
<div class='inline'><p>0.2.0</p>
|
616
|
+
</div>
|
617
|
+
|
618
|
+
</li>
|
619
|
+
|
620
|
+
</ul>
|
621
|
+
|
622
|
+
</div><table class="source_code">
|
623
|
+
<tr>
|
624
|
+
<td>
|
625
|
+
<pre class="lines">
|
626
|
+
|
627
|
+
|
628
|
+
93
|
629
|
+
94
|
630
|
+
95</pre>
|
631
|
+
</td>
|
632
|
+
<td>
|
633
|
+
<pre class="code"><span class="info file"># File 'lib/dynamoid/document.rb', line 93</span>
|
634
|
+
|
635
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_exists?'>exists?</span><span class='lparen'>(</span><span class='id identifier rubyid_id'>id</span><span class='rparen'>)</span>
|
636
|
+
<span class='op'>!</span><span class='op'>!</span> <span class='id identifier rubyid_find'>find</span><span class='lparen'>(</span><span class='id identifier rubyid_id'>id</span><span class='rparen'>)</span>
|
637
|
+
<span class='kw'>end</span></pre>
|
638
|
+
</td>
|
639
|
+
</tr>
|
640
|
+
</table>
|
641
|
+
</div>
|
642
|
+
|
643
|
+
<div class="method_details ">
|
644
|
+
<p class="signature " id="hash_key-instance_method">
|
645
|
+
|
646
|
+
- (<tt>Object</tt>) <strong>hash_key</strong>
|
647
|
+
|
648
|
+
|
649
|
+
|
650
|
+
</p><div class="docstring">
|
651
|
+
<div class="discussion">
|
652
|
+
<p>Returns the id field for this class.</p>
|
653
|
+
|
654
|
+
|
655
|
+
</div>
|
656
|
+
</div>
|
657
|
+
<div class="tags">
|
658
|
+
|
659
|
+
<h3>Since:</h3>
|
660
|
+
<ul class="since">
|
661
|
+
|
662
|
+
<li>
|
663
|
+
|
664
|
+
|
665
|
+
|
666
|
+
|
667
|
+
|
668
|
+
<div class='inline'><p>0.4.0</p>
|
669
|
+
</div>
|
670
|
+
|
671
|
+
</li>
|
672
|
+
|
673
|
+
</ul>
|
674
|
+
|
675
|
+
</div><table class="source_code">
|
676
|
+
<tr>
|
677
|
+
<td>
|
678
|
+
<pre class="lines">
|
679
|
+
|
680
|
+
|
681
|
+
49
|
682
|
+
50
|
683
|
+
51</pre>
|
684
|
+
</td>
|
685
|
+
<td>
|
686
|
+
<pre class="code"><span class="info file"># File 'lib/dynamoid/document.rb', line 49</span>
|
687
|
+
|
688
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_hash_key'>hash_key</span>
|
689
|
+
<span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:key</span><span class='rbracket'>]</span> <span class='op'>||</span> <span class='symbol'>:id</span>
|
690
|
+
<span class='kw'>end</span></pre>
|
691
|
+
</td>
|
692
|
+
</tr>
|
693
|
+
</table>
|
694
|
+
</div>
|
695
|
+
|
696
|
+
<div class="method_details ">
|
697
|
+
<p class="signature " id="read_capacity-instance_method">
|
698
|
+
|
699
|
+
- (<tt>Object</tt>) <strong>read_capacity</strong>
|
700
|
+
|
701
|
+
|
702
|
+
|
703
|
+
</p><div class="docstring">
|
704
|
+
<div class="discussion">
|
705
|
+
<p>Returns the read_capacity for this table.</p>
|
706
|
+
|
707
|
+
|
708
|
+
</div>
|
709
|
+
</div>
|
710
|
+
<div class="tags">
|
711
|
+
|
712
|
+
<h3>Since:</h3>
|
713
|
+
<ul class="since">
|
714
|
+
|
715
|
+
<li>
|
716
|
+
|
717
|
+
|
718
|
+
|
719
|
+
|
720
|
+
|
721
|
+
<div class='inline'><p>0.4.0</p>
|
722
|
+
</div>
|
723
|
+
|
724
|
+
</li>
|
725
|
+
|
726
|
+
</ul>
|
727
|
+
|
728
|
+
</div><table class="source_code">
|
729
|
+
<tr>
|
730
|
+
<td>
|
731
|
+
<pre class="lines">
|
732
|
+
|
733
|
+
|
734
|
+
35
|
735
|
+
36
|
736
|
+
37</pre>
|
737
|
+
</td>
|
738
|
+
<td>
|
739
|
+
<pre class="code"><span class="info file"># File 'lib/dynamoid/document.rb', line 35</span>
|
740
|
+
|
741
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_read_capacity'>read_capacity</span>
|
742
|
+
<span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:read_capacity</span><span class='rbracket'>]</span> <span class='op'>||</span> <span class='const'>Dynamoid</span><span class='op'>::</span><span class='const'>Config</span><span class='period'>.</span><span class='id identifier rubyid_read_capacity'>read_capacity</span>
|
743
|
+
<span class='kw'>end</span></pre>
|
744
|
+
</td>
|
745
|
+
</tr>
|
746
|
+
</table>
|
747
|
+
</div>
|
748
|
+
|
749
|
+
<div class="method_details ">
|
750
|
+
<p class="signature " id="table-instance_method">
|
751
|
+
|
752
|
+
- (<tt>Object</tt>) <strong>table</strong>(options = {})
|
753
|
+
|
754
|
+
|
755
|
+
|
756
|
+
</p><div class="docstring">
|
757
|
+
<div class="discussion">
|
758
|
+
<p>Set up table options, including naming it whatever you want, setting the id key, and manually overriding read and
|
759
|
+
write capacity.</p>
|
760
|
+
|
761
|
+
|
762
|
+
</div>
|
763
|
+
</div>
|
764
|
+
<div class="tags">
|
765
|
+
<h3>Parameters:</h3>
|
766
|
+
<ul class="param">
|
767
|
+
|
768
|
+
<li>
|
769
|
+
|
770
|
+
<span class='name'>options</span>
|
771
|
+
|
772
|
+
|
773
|
+
<span class='type'>(<tt>Hash</tt>)</span>
|
774
|
+
|
775
|
+
|
776
|
+
<em class="default">(defaults to: <tt>{}</tt>)</em>
|
777
|
+
|
778
|
+
|
779
|
+
—
|
780
|
+
<div class='inline'><p>options to pass for this table</p>
|
781
|
+
</div>
|
782
|
+
|
783
|
+
</li>
|
784
|
+
|
785
|
+
</ul>
|
786
|
+
|
787
|
+
|
788
|
+
|
789
|
+
|
790
|
+
<h3>Options Hash (<tt>options</tt>):</h3>
|
791
|
+
<ul class="option">
|
792
|
+
|
793
|
+
<li>
|
794
|
+
<span class="name">:name</span>
|
795
|
+
<span class="type">(<tt>Symbol</tt>)</span>
|
796
|
+
<span class="default">
|
797
|
+
|
798
|
+
</span>
|
799
|
+
— <div class='inline'><p>the name for the table; this still gets namespaced</p>
|
800
|
+
</div>
|
801
|
+
</li>
|
802
|
+
|
803
|
+
<li>
|
804
|
+
<span class="name">:id</span>
|
805
|
+
<span class="type">(<tt>Symbol</tt>)</span>
|
806
|
+
<span class="default">
|
807
|
+
|
808
|
+
</span>
|
809
|
+
— <div class='inline'><p>id column for the table</p>
|
810
|
+
</div>
|
811
|
+
</li>
|
812
|
+
|
813
|
+
<li>
|
814
|
+
<span class="name">:read_capacity</span>
|
815
|
+
<span class="type">(<tt>Integer</tt>)</span>
|
816
|
+
<span class="default">
|
817
|
+
|
818
|
+
</span>
|
819
|
+
— <div class='inline'><p>set the read capacity for the table; does not work on existing tables</p>
|
820
|
+
</div>
|
821
|
+
</li>
|
822
|
+
|
823
|
+
<li>
|
824
|
+
<span class="name">:write_capacity</span>
|
825
|
+
<span class="type">(<tt>Integer</tt>)</span>
|
826
|
+
<span class="default">
|
827
|
+
|
828
|
+
</span>
|
829
|
+
— <div class='inline'><p>set the write capacity for the table; does not work on existing tables</p>
|
830
|
+
</div>
|
831
|
+
</li>
|
832
|
+
|
833
|
+
</ul>
|
834
|
+
|
835
|
+
|
836
|
+
<h3>Since:</h3>
|
837
|
+
<ul class="since">
|
838
|
+
|
839
|
+
<li>
|
840
|
+
|
841
|
+
|
842
|
+
|
843
|
+
|
844
|
+
|
845
|
+
<div class='inline'><p>0.4.0</p>
|
846
|
+
</div>
|
847
|
+
|
848
|
+
</li>
|
849
|
+
|
850
|
+
</ul>
|
851
|
+
|
852
|
+
</div><table class="source_code">
|
853
|
+
<tr>
|
854
|
+
<td>
|
855
|
+
<pre class="lines">
|
856
|
+
|
857
|
+
|
858
|
+
28
|
859
|
+
29
|
860
|
+
30</pre>
|
861
|
+
</td>
|
862
|
+
<td>
|
863
|
+
<pre class="code"><span class="info file"># File 'lib/dynamoid/document.rb', line 28</span>
|
864
|
+
|
865
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_table'>table</span><span class='lparen'>(</span><span class='id identifier rubyid_options'>options</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
|
866
|
+
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_options'>options</span> <span class='op'>=</span> <span class='id identifier rubyid_options'>options</span>
|
867
|
+
<span class='kw'>end</span></pre>
|
868
|
+
</td>
|
869
|
+
</tr>
|
870
|
+
</table>
|
871
|
+
</div>
|
872
|
+
|
873
|
+
<div class="method_details ">
|
874
|
+
<p class="signature " id="write_capacity-instance_method">
|
875
|
+
|
876
|
+
- (<tt>Object</tt>) <strong>write_capacity</strong>
|
877
|
+
|
878
|
+
|
879
|
+
|
880
|
+
</p><div class="docstring">
|
881
|
+
<div class="discussion">
|
882
|
+
<p>Returns the write_capacity for this table.</p>
|
883
|
+
|
884
|
+
|
885
|
+
</div>
|
886
|
+
</div>
|
887
|
+
<div class="tags">
|
888
|
+
|
889
|
+
<h3>Since:</h3>
|
890
|
+
<ul class="since">
|
891
|
+
|
892
|
+
<li>
|
893
|
+
|
894
|
+
|
895
|
+
|
896
|
+
|
897
|
+
|
898
|
+
<div class='inline'><p>0.4.0</p>
|
899
|
+
</div>
|
900
|
+
|
901
|
+
</li>
|
902
|
+
|
903
|
+
</ul>
|
904
|
+
|
905
|
+
</div><table class="source_code">
|
906
|
+
<tr>
|
907
|
+
<td>
|
908
|
+
<pre class="lines">
|
909
|
+
|
910
|
+
|
911
|
+
42
|
912
|
+
43
|
913
|
+
44</pre>
|
914
|
+
</td>
|
915
|
+
<td>
|
916
|
+
<pre class="code"><span class="info file"># File 'lib/dynamoid/document.rb', line 42</span>
|
917
|
+
|
918
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_write_capacity'>write_capacity</span>
|
919
|
+
<span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:write_capacity</span><span class='rbracket'>]</span> <span class='op'>||</span> <span class='const'>Dynamoid</span><span class='op'>::</span><span class='const'>Config</span><span class='period'>.</span><span class='id identifier rubyid_write_capacity'>write_capacity</span>
|
920
|
+
<span class='kw'>end</span></pre>
|
921
|
+
</td>
|
922
|
+
</tr>
|
923
|
+
</table>
|
924
|
+
</div>
|
925
|
+
|
926
|
+
</div>
|
927
|
+
|
928
|
+
</div>
|
929
|
+
|
930
|
+
<div id="footer">
|
931
|
+
Generated on Thu Apr 26 01:26:25 2012 by
|
932
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
933
|
+
0.7.5 (ruby-1.9.3).
|
934
|
+
</div>
|
935
|
+
|
936
|
+
</body>
|
937
|
+
</html>
|