dynamoid 0.6.1 → 0.7.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.travis.yml +4 -0
- data/Gemfile +3 -2
- data/Gemfile.lock +40 -45
- data/README.markdown +55 -25
- data/Rakefile +31 -0
- data/VERSION +1 -1
- data/doc/Dynamoid.html +58 -42
- data/doc/Dynamoid/Adapter.html +666 -179
- data/doc/Dynamoid/Adapter/AwsSdk.html +752 -236
- data/doc/Dynamoid/Associations.html +28 -21
- data/doc/Dynamoid/Associations/Association.html +102 -49
- data/doc/Dynamoid/Associations/BelongsTo.html +28 -25
- data/doc/Dynamoid/Associations/ClassMethods.html +95 -52
- data/doc/Dynamoid/Associations/HasAndBelongsToMany.html +28 -25
- data/doc/Dynamoid/Associations/HasMany.html +28 -25
- data/doc/Dynamoid/Associations/HasOne.html +28 -25
- data/doc/Dynamoid/Associations/ManyAssociation.html +138 -94
- data/doc/Dynamoid/Associations/SingleAssociation.html +67 -38
- data/doc/Dynamoid/Components.html +60 -22
- data/doc/Dynamoid/Config.html +61 -44
- data/doc/Dynamoid/Config/Options.html +90 -61
- data/doc/Dynamoid/Criteria.html +28 -21
- data/doc/Dynamoid/Criteria/Chain.html +508 -100
- data/doc/Dynamoid/Criteria/ClassMethods.html +26 -19
- data/doc/Dynamoid/Dirty.html +424 -0
- data/doc/Dynamoid/Dirty/ClassMethods.html +174 -0
- data/doc/Dynamoid/Document.html +451 -84
- data/doc/Dynamoid/Document/ClassMethods.html +281 -102
- data/doc/Dynamoid/Errors.html +29 -22
- data/doc/Dynamoid/Errors/ConditionalCheckFailedException.html +141 -0
- data/doc/Dynamoid/Errors/DocumentNotValid.html +36 -25
- data/doc/Dynamoid/Errors/Error.html +27 -20
- data/doc/Dynamoid/Errors/InvalidField.html +27 -19
- data/doc/Dynamoid/Errors/InvalidQuery.html +131 -0
- data/doc/Dynamoid/Errors/MissingRangeKey.html +27 -19
- data/doc/Dynamoid/Fields.html +94 -77
- data/doc/Dynamoid/Fields/ClassMethods.html +166 -37
- data/doc/Dynamoid/Finders.html +28 -21
- data/doc/Dynamoid/Finders/ClassMethods.html +505 -78
- data/doc/Dynamoid/IdentityMap.html +492 -0
- data/doc/Dynamoid/IdentityMap/ClassMethods.html +534 -0
- data/doc/Dynamoid/Indexes.html +41 -28
- data/doc/Dynamoid/Indexes/ClassMethods.html +45 -29
- data/doc/Dynamoid/Indexes/Index.html +100 -62
- data/doc/Dynamoid/Middleware.html +115 -0
- data/doc/Dynamoid/Middleware/IdentityMap.html +264 -0
- data/doc/Dynamoid/Persistence.html +326 -85
- data/doc/Dynamoid/Persistence/ClassMethods.html +275 -109
- data/doc/Dynamoid/Validations.html +47 -31
- data/doc/_index.html +116 -71
- data/doc/class_list.html +13 -7
- data/doc/css/full_list.css +4 -2
- data/doc/css/style.css +60 -44
- data/doc/file.LICENSE.html +26 -19
- data/doc/file.README.html +152 -48
- data/doc/file_list.html +14 -8
- data/doc/frames.html +20 -5
- data/doc/index.html +152 -48
- data/doc/js/app.js +52 -43
- data/doc/js/full_list.js +14 -9
- data/doc/js/jquery.js +4 -16
- data/doc/method_list.html +446 -540
- data/doc/top-level-namespace.html +27 -20
- data/{Dynamoid.gemspec → dynamoid.gemspec} +21 -8
- data/lib/dynamoid/adapter.rb +11 -10
- data/lib/dynamoid/adapter/aws_sdk.rb +40 -19
- data/lib/dynamoid/components.rb +2 -1
- data/lib/dynamoid/criteria/chain.rb +29 -11
- data/lib/dynamoid/dirty.rb +6 -0
- data/lib/dynamoid/document.rb +34 -19
- data/lib/dynamoid/fields.rb +36 -30
- data/lib/dynamoid/finders.rb +7 -5
- data/lib/dynamoid/persistence.rb +37 -10
- data/spec/app/models/address.rb +2 -0
- data/spec/app/models/camel_case.rb +10 -0
- data/spec/app/models/car.rb +6 -0
- data/spec/app/models/nuclear_submarine.rb +5 -0
- data/spec/app/models/subscription.rb +2 -2
- data/spec/app/models/vehicle.rb +7 -0
- data/spec/dynamoid/adapter/aws_sdk_spec.rb +20 -11
- data/spec/dynamoid/adapter_spec.rb +67 -82
- data/spec/dynamoid/associations/association_spec.rb +30 -30
- data/spec/dynamoid/criteria/chain_spec.rb +56 -9
- data/spec/dynamoid/criteria_spec.rb +3 -0
- data/spec/dynamoid/dirty_spec.rb +8 -0
- data/spec/dynamoid/document_spec.rb +109 -47
- data/spec/dynamoid/fields_spec.rb +32 -3
- data/spec/dynamoid/finders_spec.rb +12 -0
- data/spec/dynamoid/persistence_spec.rb +73 -8
- data/spec/spec_helper.rb +1 -0
- data/spec/support/with_partitioning.rb +15 -0
- metadata +22 -9
data/doc/Dynamoid/Indexes.html
CHANGED
@@ -6,19 +6,21 @@
|
|
6
6
|
<title>
|
7
7
|
Module: Dynamoid::Indexes
|
8
8
|
|
9
|
-
— Documentation by YARD 0.
|
9
|
+
— Documentation by YARD 0.8.6.1
|
10
10
|
|
11
11
|
</title>
|
12
12
|
|
13
|
-
<link rel="stylesheet" href="../css/style.css" type="text/css"
|
13
|
+
<link rel="stylesheet" href="../css/style.css" type="text/css" charset="utf-8" />
|
14
14
|
|
15
|
-
<link rel="stylesheet" href="../css/common.css" type="text/css"
|
15
|
+
<link rel="stylesheet" href="../css/common.css" type="text/css" charset="utf-8" />
|
16
16
|
|
17
17
|
<script type="text/javascript" charset="utf-8">
|
18
|
-
|
19
|
-
|
18
|
+
hasFrames = window.top.frames.main ? true : false;
|
19
|
+
relpath = '../';
|
20
|
+
framesUrl = "../frames.html#!" + escape(window.location.href);
|
20
21
|
</script>
|
21
22
|
|
23
|
+
|
22
24
|
<script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
|
23
25
|
|
24
26
|
<script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
|
@@ -26,36 +28,41 @@
|
|
26
28
|
|
27
29
|
</head>
|
28
30
|
<body>
|
29
|
-
<script type="text/javascript" charset="utf-8">
|
30
|
-
if (window.top.frames.main) document.body.className = 'frames';
|
31
|
-
</script>
|
32
|
-
|
33
31
|
<div id="header">
|
34
32
|
<div id="menu">
|
35
33
|
|
36
|
-
<a href="../_index.html">Index (I)</a> »
|
34
|
+
<a href="../_index.html">Index (I)</a> »
|
37
35
|
<span class='title'><span class='object_link'><a href="../Dynamoid.html" title="Dynamoid (module)">Dynamoid</a></span></span>
|
38
36
|
»
|
39
37
|
<span class="title">Indexes</span>
|
40
38
|
|
41
|
-
|
39
|
+
|
42
40
|
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
43
41
|
</div>
|
44
42
|
|
45
43
|
<div id="search">
|
46
44
|
|
47
|
-
<a
|
45
|
+
<a class="full_list_link" id="class_list_link"
|
46
|
+
href="../class_list.html">
|
47
|
+
Class List
|
48
|
+
</a>
|
48
49
|
|
49
|
-
<a
|
50
|
+
<a class="full_list_link" id="method_list_link"
|
51
|
+
href="../method_list.html">
|
52
|
+
Method List
|
53
|
+
</a>
|
50
54
|
|
51
|
-
<a
|
55
|
+
<a class="full_list_link" id="file_list_link"
|
56
|
+
href="../file_list.html">
|
57
|
+
File List
|
58
|
+
</a>
|
52
59
|
|
53
60
|
</div>
|
54
61
|
<div class="clear"></div>
|
55
62
|
</div>
|
56
|
-
|
63
|
+
|
57
64
|
<iframe id="search_frame"></iframe>
|
58
|
-
|
65
|
+
|
59
66
|
<div id="content"><h1>Module: Dynamoid::Indexes
|
60
67
|
|
61
68
|
|
@@ -101,11 +108,11 @@ we perform indexing).</p>
|
|
101
108
|
|
102
109
|
</div><h2>Defined Under Namespace</h2>
|
103
110
|
<p class="children">
|
104
|
-
|
111
|
+
|
105
112
|
|
106
113
|
<strong class="modules">Modules:</strong> <span class='object_link'><a href="Indexes/ClassMethods.html" title="Dynamoid::Indexes::ClassMethods (module)">ClassMethods</a></span>
|
107
114
|
|
108
|
-
|
115
|
+
|
109
116
|
|
110
117
|
<strong class="classes">Classes:</strong> <span class='object_link'><a href="Indexes/Index.html" title="Dynamoid::Indexes::Index (class)">Index</a></span>
|
111
118
|
|
@@ -140,6 +147,7 @@ we perform indexing).</p>
|
|
140
147
|
|
141
148
|
|
142
149
|
|
150
|
+
|
143
151
|
|
144
152
|
|
145
153
|
<span class="summary_desc"><div class='inline'><p>Callback for an object to delete itself from each of a class' indexes.</p>
|
@@ -162,6 +170,7 @@ we perform indexing).</p>
|
|
162
170
|
|
163
171
|
|
164
172
|
|
173
|
+
|
165
174
|
|
166
175
|
|
167
176
|
<span class="summary_desc"><div class='inline'><p>Callback for an object to save itself to each of a class' indexes.</p>
|
@@ -178,16 +187,18 @@ we perform indexing).</p>
|
|
178
187
|
|
179
188
|
<div id="instance_method_details" class="method_details_list">
|
180
189
|
<h2>Instance Method Details</h2>
|
181
|
-
|
190
|
+
|
182
191
|
|
183
192
|
<div class="method_details first">
|
184
|
-
<
|
193
|
+
<h3 class="signature first" id="delete_indexes-instance_method">
|
185
194
|
|
186
195
|
- (<tt>Object</tt>) <strong>delete_indexes</strong>
|
187
196
|
|
188
197
|
|
189
198
|
|
190
|
-
|
199
|
+
|
200
|
+
|
201
|
+
</h3><div class="docstring">
|
191
202
|
<div class="discussion">
|
192
203
|
<p>Callback for an object to delete itself from each of a class' indexes.</p>
|
193
204
|
|
@@ -196,7 +207,7 @@ we perform indexing).</p>
|
|
196
207
|
</div>
|
197
208
|
<div class="tags">
|
198
209
|
|
199
|
-
<
|
210
|
+
<p class="tag_title">Since:</p>
|
200
211
|
<ul class="since">
|
201
212
|
|
202
213
|
<li>
|
@@ -238,13 +249,15 @@ we perform indexing).</p>
|
|
238
249
|
</div>
|
239
250
|
|
240
251
|
<div class="method_details ">
|
241
|
-
<
|
252
|
+
<h3 class="signature " id="save_indexes-instance_method">
|
242
253
|
|
243
254
|
- (<tt>Object</tt>) <strong>save_indexes</strong>
|
244
255
|
|
245
256
|
|
246
257
|
|
247
|
-
|
258
|
+
|
259
|
+
|
260
|
+
</h3><div class="docstring">
|
248
261
|
<div class="discussion">
|
249
262
|
<p>Callback for an object to save itself to each of a class' indexes.</p>
|
250
263
|
|
@@ -253,7 +266,7 @@ we perform indexing).</p>
|
|
253
266
|
</div>
|
254
267
|
<div class="tags">
|
255
268
|
|
256
|
-
<
|
269
|
+
<p class="tag_title">Since:</p>
|
257
270
|
<ul class="since">
|
258
271
|
|
259
272
|
<li>
|
@@ -297,11 +310,11 @@ we perform indexing).</p>
|
|
297
310
|
</div>
|
298
311
|
|
299
312
|
</div>
|
300
|
-
|
313
|
+
|
301
314
|
<div id="footer">
|
302
|
-
Generated on Thu
|
315
|
+
Generated on Thu Jun 27 21:59:10 2013 by
|
303
316
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
304
|
-
0.
|
317
|
+
0.8.6.1 (ruby-1.9.3).
|
305
318
|
</div>
|
306
319
|
|
307
320
|
</body>
|
@@ -6,19 +6,21 @@
|
|
6
6
|
<title>
|
7
7
|
Module: Dynamoid::Indexes::ClassMethods
|
8
8
|
|
9
|
-
— Documentation by YARD 0.
|
9
|
+
— Documentation by YARD 0.8.6.1
|
10
10
|
|
11
11
|
</title>
|
12
12
|
|
13
|
-
<link rel="stylesheet" href="../../css/style.css" type="text/css"
|
13
|
+
<link rel="stylesheet" href="../../css/style.css" type="text/css" charset="utf-8" />
|
14
14
|
|
15
|
-
<link rel="stylesheet" href="../../css/common.css" type="text/css"
|
15
|
+
<link rel="stylesheet" href="../../css/common.css" type="text/css" charset="utf-8" />
|
16
16
|
|
17
17
|
<script type="text/javascript" charset="utf-8">
|
18
|
-
|
19
|
-
|
18
|
+
hasFrames = window.top.frames.main ? true : false;
|
19
|
+
relpath = '../../';
|
20
|
+
framesUrl = "../../frames.html#!" + escape(window.location.href);
|
20
21
|
</script>
|
21
22
|
|
23
|
+
|
22
24
|
<script type="text/javascript" charset="utf-8" src="../../js/jquery.js"></script>
|
23
25
|
|
24
26
|
<script type="text/javascript" charset="utf-8" src="../../js/app.js"></script>
|
@@ -26,36 +28,41 @@
|
|
26
28
|
|
27
29
|
</head>
|
28
30
|
<body>
|
29
|
-
<script type="text/javascript" charset="utf-8">
|
30
|
-
if (window.top.frames.main) document.body.className = 'frames';
|
31
|
-
</script>
|
32
|
-
|
33
31
|
<div id="header">
|
34
32
|
<div id="menu">
|
35
33
|
|
36
|
-
<a href="../../_index.html">Index (C)</a> »
|
34
|
+
<a href="../../_index.html">Index (C)</a> »
|
37
35
|
<span class='title'><span class='object_link'><a href="../../Dynamoid.html" title="Dynamoid (module)">Dynamoid</a></span></span> » <span class='title'><span class='object_link'><a href="../Indexes.html" title="Dynamoid::Indexes (module)">Indexes</a></span></span>
|
38
36
|
»
|
39
37
|
<span class="title">ClassMethods</span>
|
40
38
|
|
41
|
-
|
39
|
+
|
42
40
|
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
43
41
|
</div>
|
44
42
|
|
45
43
|
<div id="search">
|
46
44
|
|
47
|
-
<a
|
45
|
+
<a class="full_list_link" id="class_list_link"
|
46
|
+
href="../../class_list.html">
|
47
|
+
Class List
|
48
|
+
</a>
|
48
49
|
|
49
|
-
<a
|
50
|
+
<a class="full_list_link" id="method_list_link"
|
51
|
+
href="../../method_list.html">
|
52
|
+
Method List
|
53
|
+
</a>
|
50
54
|
|
51
|
-
<a
|
55
|
+
<a class="full_list_link" id="file_list_link"
|
56
|
+
href="../../file_list.html">
|
57
|
+
File List
|
58
|
+
</a>
|
52
59
|
|
53
60
|
</div>
|
54
61
|
<div class="clear"></div>
|
55
62
|
</div>
|
56
|
-
|
63
|
+
|
57
64
|
<iframe id="search_frame"></iframe>
|
58
|
-
|
65
|
+
|
59
66
|
<div id="content"><h1>Module: Dynamoid::Indexes::ClassMethods
|
60
67
|
|
61
68
|
|
@@ -106,6 +113,7 @@
|
|
106
113
|
|
107
114
|
|
108
115
|
|
116
|
+
|
109
117
|
|
110
118
|
|
111
119
|
<span class="summary_desc"><div class='inline'><p>Helper function to create indexes (if they don't exist already).</p>
|
@@ -128,6 +136,7 @@
|
|
128
136
|
|
129
137
|
|
130
138
|
|
139
|
+
|
131
140
|
|
132
141
|
|
133
142
|
<span class="summary_desc"><div class='inline'><p>Helper function to find indexes.</p>
|
@@ -150,6 +159,7 @@
|
|
150
159
|
|
151
160
|
|
152
161
|
|
162
|
+
|
153
163
|
|
154
164
|
|
155
165
|
<span class="summary_desc"><div class='inline'><p>The call to create an index.</p>
|
@@ -165,16 +175,18 @@
|
|
165
175
|
|
166
176
|
<div id="instance_method_details" class="method_details_list">
|
167
177
|
<h2>Instance Method Details</h2>
|
168
|
-
|
178
|
+
|
169
179
|
|
170
180
|
<div class="method_details first">
|
171
|
-
<
|
181
|
+
<h3 class="signature first" id="create_indexes-instance_method">
|
172
182
|
|
173
183
|
- (<tt>Object</tt>) <strong>create_indexes</strong>
|
174
184
|
|
175
185
|
|
176
186
|
|
177
|
-
|
187
|
+
|
188
|
+
|
189
|
+
</h3><div class="docstring">
|
178
190
|
<div class="discussion">
|
179
191
|
<p>Helper function to create indexes (if they don't exist already).</p>
|
180
192
|
|
@@ -183,7 +195,7 @@
|
|
183
195
|
</div>
|
184
196
|
<div class="tags">
|
185
197
|
|
186
|
-
<
|
198
|
+
<p class="tag_title">Since:</p>
|
187
199
|
<ul class="since">
|
188
200
|
|
189
201
|
<li>
|
@@ -229,13 +241,15 @@
|
|
229
241
|
</div>
|
230
242
|
|
231
243
|
<div class="method_details ">
|
232
|
-
<
|
244
|
+
<h3 class="signature " id="find_index-instance_method">
|
233
245
|
|
234
246
|
- (<tt>Object</tt>) <strong>find_index</strong>(index)
|
235
247
|
|
236
248
|
|
237
249
|
|
238
|
-
|
250
|
+
|
251
|
+
|
252
|
+
</h3><div class="docstring">
|
239
253
|
<div class="discussion">
|
240
254
|
<p>Helper function to find indexes.</p>
|
241
255
|
|
@@ -244,7 +258,7 @@
|
|
244
258
|
</div>
|
245
259
|
<div class="tags">
|
246
260
|
|
247
|
-
<
|
261
|
+
<p class="tag_title">Since:</p>
|
248
262
|
<ul class="since">
|
249
263
|
|
250
264
|
<li>
|
@@ -282,13 +296,15 @@
|
|
282
296
|
</div>
|
283
297
|
|
284
298
|
<div class="method_details ">
|
285
|
-
<
|
299
|
+
<h3 class="signature " id="index-instance_method">
|
286
300
|
|
287
301
|
- (<tt>Object</tt>) <strong>index</strong>(name, options = {})
|
288
302
|
|
289
303
|
|
290
304
|
|
291
|
-
|
305
|
+
|
306
|
+
|
307
|
+
</h3><div class="docstring">
|
292
308
|
<div class="discussion">
|
293
309
|
<p>The call to create an index. Generates a new index with the specified options -- for more information, see Dynamoid::Indexes::Index.
|
294
310
|
This function also attempts to immediately create the indexing table if it does not exist already.</p>
|
@@ -298,7 +314,7 @@ This function also attempts to immediately create the indexing table if it does
|
|
298
314
|
</div>
|
299
315
|
<div class="tags">
|
300
316
|
|
301
|
-
<
|
317
|
+
<p class="tag_title">Since:</p>
|
302
318
|
<ul class="since">
|
303
319
|
|
304
320
|
<li>
|
@@ -342,11 +358,11 @@ This function also attempts to immediately create the indexing table if it does
|
|
342
358
|
</div>
|
343
359
|
|
344
360
|
</div>
|
345
|
-
|
361
|
+
|
346
362
|
<div id="footer">
|
347
|
-
Generated on Thu
|
363
|
+
Generated on Thu Jun 27 21:59:10 2013 by
|
348
364
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
349
|
-
0.
|
365
|
+
0.8.6.1 (ruby-1.9.3).
|
350
366
|
</div>
|
351
367
|
|
352
368
|
</body>
|
@@ -6,19 +6,21 @@
|
|
6
6
|
<title>
|
7
7
|
Class: Dynamoid::Indexes::Index
|
8
8
|
|
9
|
-
— Documentation by YARD 0.
|
9
|
+
— Documentation by YARD 0.8.6.1
|
10
10
|
|
11
11
|
</title>
|
12
12
|
|
13
|
-
<link rel="stylesheet" href="../../css/style.css" type="text/css"
|
13
|
+
<link rel="stylesheet" href="../../css/style.css" type="text/css" charset="utf-8" />
|
14
14
|
|
15
|
-
<link rel="stylesheet" href="../../css/common.css" type="text/css"
|
15
|
+
<link rel="stylesheet" href="../../css/common.css" type="text/css" charset="utf-8" />
|
16
16
|
|
17
17
|
<script type="text/javascript" charset="utf-8">
|
18
|
-
|
19
|
-
|
18
|
+
hasFrames = window.top.frames.main ? true : false;
|
19
|
+
relpath = '../../';
|
20
|
+
framesUrl = "../../frames.html#!" + escape(window.location.href);
|
20
21
|
</script>
|
21
22
|
|
23
|
+
|
22
24
|
<script type="text/javascript" charset="utf-8" src="../../js/jquery.js"></script>
|
23
25
|
|
24
26
|
<script type="text/javascript" charset="utf-8" src="../../js/app.js"></script>
|
@@ -26,36 +28,41 @@
|
|
26
28
|
|
27
29
|
</head>
|
28
30
|
<body>
|
29
|
-
<script type="text/javascript" charset="utf-8">
|
30
|
-
if (window.top.frames.main) document.body.className = 'frames';
|
31
|
-
</script>
|
32
|
-
|
33
31
|
<div id="header">
|
34
32
|
<div id="menu">
|
35
33
|
|
36
|
-
<a href="../../_index.html">Index (I)</a> »
|
34
|
+
<a href="../../_index.html">Index (I)</a> »
|
37
35
|
<span class='title'><span class='object_link'><a href="../../Dynamoid.html" title="Dynamoid (module)">Dynamoid</a></span></span> » <span class='title'><span class='object_link'><a href="../Indexes.html" title="Dynamoid::Indexes (module)">Indexes</a></span></span>
|
38
36
|
»
|
39
37
|
<span class="title">Index</span>
|
40
38
|
|
41
|
-
|
39
|
+
|
42
40
|
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
43
41
|
</div>
|
44
42
|
|
45
43
|
<div id="search">
|
46
44
|
|
47
|
-
<a
|
45
|
+
<a class="full_list_link" id="class_list_link"
|
46
|
+
href="../../class_list.html">
|
47
|
+
Class List
|
48
|
+
</a>
|
48
49
|
|
49
|
-
<a
|
50
|
+
<a class="full_list_link" id="method_list_link"
|
51
|
+
href="../../method_list.html">
|
52
|
+
Method List
|
53
|
+
</a>
|
50
54
|
|
51
|
-
<a
|
55
|
+
<a class="full_list_link" id="file_list_link"
|
56
|
+
href="../../file_list.html">
|
57
|
+
File List
|
58
|
+
</a>
|
52
59
|
|
53
60
|
</div>
|
54
61
|
<div class="clear"></div>
|
55
62
|
</div>
|
56
|
-
|
63
|
+
|
57
64
|
<iframe id="search_frame"></iframe>
|
58
|
-
|
65
|
+
|
59
66
|
<div id="content"><h1>Class: Dynamoid::Indexes::Index
|
60
67
|
|
61
68
|
|
@@ -119,6 +126,7 @@
|
|
119
126
|
</span>
|
120
127
|
|
121
128
|
|
129
|
+
|
122
130
|
|
123
131
|
|
124
132
|
|
@@ -144,6 +152,7 @@
|
|
144
152
|
</span>
|
145
153
|
|
146
154
|
|
155
|
+
|
147
156
|
|
148
157
|
|
149
158
|
|
@@ -171,6 +180,7 @@
|
|
171
180
|
</span>
|
172
181
|
|
173
182
|
|
183
|
+
|
174
184
|
|
175
185
|
|
176
186
|
|
@@ -196,6 +206,7 @@
|
|
196
206
|
</span>
|
197
207
|
|
198
208
|
|
209
|
+
|
199
210
|
|
200
211
|
|
201
212
|
|
@@ -238,6 +249,7 @@
|
|
238
249
|
|
239
250
|
|
240
251
|
|
252
|
+
|
241
253
|
|
242
254
|
|
243
255
|
<span class="summary_desc"><div class='inline'><p>Delete an object from this index, preserving existing ids if there are any, and failing gracefully if for some reason the
|
@@ -256,6 +268,7 @@ index doesn't already have this object in it.</p>
|
|
256
268
|
|
257
269
|
</span>
|
258
270
|
|
271
|
+
|
259
272
|
<span class="note title constructor">constructor</span>
|
260
273
|
|
261
274
|
|
@@ -285,6 +298,7 @@ index doesn't already have this object in it.</p>
|
|
285
298
|
|
286
299
|
|
287
300
|
|
301
|
+
|
288
302
|
|
289
303
|
|
290
304
|
<span class="summary_desc"><div class='inline'><p>Return the array of keys this index uses for its table.</p>
|
@@ -307,6 +321,7 @@ index doesn't already have this object in it.</p>
|
|
307
321
|
|
308
322
|
|
309
323
|
|
324
|
+
|
310
325
|
|
311
326
|
|
312
327
|
<span class="summary_desc"><div class='inline'><p>Save an object to this index, merging it with existing ids if there's already something present at this index location.</p>
|
@@ -329,6 +344,7 @@ index doesn't already have this object in it.</p>
|
|
329
344
|
|
330
345
|
|
331
346
|
|
347
|
+
|
332
348
|
|
333
349
|
|
334
350
|
<span class="summary_desc"><div class='inline'><p>Sort objects into alphabetical strings, used for composing index names correctly (since we always assume they're alphabetical).</p>
|
@@ -351,6 +367,7 @@ index doesn't already have this object in it.</p>
|
|
351
367
|
|
352
368
|
|
353
369
|
|
370
|
+
|
354
371
|
|
355
372
|
|
356
373
|
<span class="summary_desc"><div class='inline'><p>Return the table name for this index.</p>
|
@@ -373,6 +390,7 @@ index doesn't already have this object in it.</p>
|
|
373
390
|
|
374
391
|
|
375
392
|
|
393
|
+
|
376
394
|
|
377
395
|
|
378
396
|
<span class="summary_desc"><div class='inline'><p>Given either an object or a list of attributes, generate a hash key and a range key for the index.</p>
|
@@ -388,13 +406,15 @@ index doesn't already have this object in it.</p>
|
|
388
406
|
<h2>Constructor Details</h2>
|
389
407
|
|
390
408
|
<div class="method_details first">
|
391
|
-
<
|
409
|
+
<h3 class="signature first" id="initialize-instance_method">
|
392
410
|
|
393
411
|
- (<tt><span class='object_link'><a href="" title="Dynamoid::Indexes::Index (class)">Index</a></span></tt>) <strong>initialize</strong>(source, name, options = {})
|
394
412
|
|
395
413
|
|
396
414
|
|
397
|
-
|
415
|
+
|
416
|
+
|
417
|
+
</h3><div class="docstring">
|
398
418
|
<div class="discussion">
|
399
419
|
<p>Create a new index. Pass either :range => true or :range => :column_name to create a ranged index on that column.</p>
|
400
420
|
|
@@ -402,7 +422,7 @@ index doesn't already have this object in it.</p>
|
|
402
422
|
</div>
|
403
423
|
</div>
|
404
424
|
<div class="tags">
|
405
|
-
<
|
425
|
+
<p class="tag_title">Parameters:</p>
|
406
426
|
<ul class="param">
|
407
427
|
|
408
428
|
<li>
|
@@ -437,7 +457,7 @@ index doesn't already have this object in it.</p>
|
|
437
457
|
|
438
458
|
</ul>
|
439
459
|
|
440
|
-
<
|
460
|
+
<p class="tag_title">Raises:</p>
|
441
461
|
<ul class="raise">
|
442
462
|
|
443
463
|
<li>
|
@@ -450,7 +470,7 @@ index doesn't already have this object in it.</p>
|
|
450
470
|
</li>
|
451
471
|
|
452
472
|
</ul>
|
453
|
-
<
|
473
|
+
<p class="tag_title">Since:</p>
|
454
474
|
<ul class="since">
|
455
475
|
|
456
476
|
<li>
|
@@ -514,15 +534,16 @@ index doesn't already have this object in it.</p>
|
|
514
534
|
|
515
535
|
|
516
536
|
<span id="hash_keys=-instance_method"></span>
|
517
|
-
<span id="hash_keys-instance_method"></span>
|
518
537
|
<div class="method_details first">
|
519
|
-
<
|
538
|
+
<h3 class="signature first" id="hash_keys-instance_method">
|
520
539
|
|
521
540
|
- (<tt>Object</tt>) <strong>hash_keys</strong>
|
522
541
|
|
523
542
|
|
524
543
|
|
525
|
-
|
544
|
+
|
545
|
+
|
546
|
+
</h3><div class="docstring">
|
526
547
|
<div class="discussion">
|
527
548
|
<p>Returns the value of attribute hash_keys</p>
|
528
549
|
|
@@ -555,15 +576,16 @@ index doesn't already have this object in it.</p>
|
|
555
576
|
|
556
577
|
|
557
578
|
<span id="name=-instance_method"></span>
|
558
|
-
<span id="name-instance_method"></span>
|
559
579
|
<div class="method_details ">
|
560
|
-
<
|
580
|
+
<h3 class="signature " id="name-instance_method">
|
561
581
|
|
562
582
|
- (<tt>Object</tt>) <strong>name</strong>
|
563
583
|
|
564
584
|
|
565
585
|
|
566
|
-
|
586
|
+
|
587
|
+
|
588
|
+
</h3><div class="docstring">
|
567
589
|
<div class="discussion">
|
568
590
|
<p>Returns the value of attribute name</p>
|
569
591
|
|
@@ -596,9 +618,8 @@ index doesn't already have this object in it.</p>
|
|
596
618
|
|
597
619
|
|
598
620
|
<span id="range_keys=-instance_method"></span>
|
599
|
-
<span id="range_keys-instance_method"></span>
|
600
621
|
<div class="method_details ">
|
601
|
-
<
|
622
|
+
<h3 class="signature " id="range_keys-instance_method">
|
602
623
|
|
603
624
|
- (<tt>Object</tt>) <strong>range_keys</strong>
|
604
625
|
|
@@ -608,7 +629,9 @@ index doesn't already have this object in it.</p>
|
|
608
629
|
<span class="names"><span id='range_key?-instance_method'>range_key?</span></span>
|
609
630
|
</span>
|
610
631
|
|
611
|
-
|
632
|
+
|
633
|
+
|
634
|
+
</h3><div class="docstring">
|
612
635
|
<div class="discussion">
|
613
636
|
<p>Returns the value of attribute range_keys</p>
|
614
637
|
|
@@ -641,15 +664,16 @@ index doesn't already have this object in it.</p>
|
|
641
664
|
|
642
665
|
|
643
666
|
<span id="source=-instance_method"></span>
|
644
|
-
<span id="source-instance_method"></span>
|
645
667
|
<div class="method_details ">
|
646
|
-
<
|
668
|
+
<h3 class="signature " id="source-instance_method">
|
647
669
|
|
648
670
|
- (<tt>Object</tt>) <strong>source</strong>
|
649
671
|
|
650
672
|
|
651
673
|
|
652
|
-
|
674
|
+
|
675
|
+
|
676
|
+
</h3><div class="docstring">
|
653
677
|
<div class="discussion">
|
654
678
|
<p>Returns the value of attribute source</p>
|
655
679
|
|
@@ -685,16 +709,18 @@ index doesn't already have this object in it.</p>
|
|
685
709
|
|
686
710
|
<div id="instance_method_details" class="method_details_list">
|
687
711
|
<h2>Instance Method Details</h2>
|
688
|
-
|
712
|
+
|
689
713
|
|
690
714
|
<div class="method_details first">
|
691
|
-
<
|
715
|
+
<h3 class="signature first" id="delete-instance_method">
|
692
716
|
|
693
717
|
- (<tt>Object</tt>) <strong>delete</strong>(obj, changed_attributes = false)
|
694
718
|
|
695
719
|
|
696
720
|
|
697
|
-
|
721
|
+
|
722
|
+
|
723
|
+
</h3><div class="docstring">
|
698
724
|
<div class="discussion">
|
699
725
|
<p>Delete an object from this index, preserving existing ids if there are any, and failing gracefully if for some reason the
|
700
726
|
index doesn't already have this object in it.</p>
|
@@ -704,7 +730,7 @@ index doesn't already have this object in it.</p>
|
|
704
730
|
</div>
|
705
731
|
<div class="tags">
|
706
732
|
|
707
|
-
<
|
733
|
+
<p class="tag_title">Since:</p>
|
708
734
|
<ul class="since">
|
709
735
|
|
710
736
|
<li>
|
@@ -750,13 +776,15 @@ index doesn't already have this object in it.</p>
|
|
750
776
|
</div>
|
751
777
|
|
752
778
|
<div class="method_details ">
|
753
|
-
<
|
779
|
+
<h3 class="signature " id="keys-instance_method">
|
754
780
|
|
755
781
|
- (<tt>Object</tt>) <strong>keys</strong>
|
756
782
|
|
757
783
|
|
758
784
|
|
759
|
-
|
785
|
+
|
786
|
+
|
787
|
+
</h3><div class="docstring">
|
760
788
|
<div class="discussion">
|
761
789
|
<p>Return the array of keys this index uses for its table.</p>
|
762
790
|
|
@@ -765,7 +793,7 @@ index doesn't already have this object in it.</p>
|
|
765
793
|
</div>
|
766
794
|
<div class="tags">
|
767
795
|
|
768
|
-
<
|
796
|
+
<p class="tag_title">Since:</p>
|
769
797
|
<ul class="since">
|
770
798
|
|
771
799
|
<li>
|
@@ -803,13 +831,15 @@ index doesn't already have this object in it.</p>
|
|
803
831
|
</div>
|
804
832
|
|
805
833
|
<div class="method_details ">
|
806
|
-
<
|
834
|
+
<h3 class="signature " id="save-instance_method">
|
807
835
|
|
808
836
|
- (<tt>Object</tt>) <strong>save</strong>(obj)
|
809
837
|
|
810
838
|
|
811
839
|
|
812
|
-
|
840
|
+
|
841
|
+
|
842
|
+
</h3><div class="docstring">
|
813
843
|
<div class="discussion">
|
814
844
|
<p>Save an object to this index, merging it with existing ids if there's already something present at this index location.
|
815
845
|
First, though, delete this object from its old indexes (so the object isn't listed in an erroneous index).</p>
|
@@ -819,7 +849,7 @@ First, though, delete this object from its old indexes (so the object isn't list
|
|
819
849
|
</div>
|
820
850
|
<div class="tags">
|
821
851
|
|
822
|
-
<
|
852
|
+
<p class="tag_title">Since:</p>
|
823
853
|
<ul class="since">
|
824
854
|
|
825
855
|
<li>
|
@@ -867,13 +897,15 @@ First, though, delete this object from its old indexes (so the object isn't list
|
|
867
897
|
</div>
|
868
898
|
|
869
899
|
<div class="method_details ">
|
870
|
-
<
|
900
|
+
<h3 class="signature " id="sort-instance_method">
|
871
901
|
|
872
902
|
- (<tt>Object</tt>) <strong>sort</strong>(objs)
|
873
903
|
|
874
904
|
|
875
905
|
|
876
|
-
|
906
|
+
|
907
|
+
|
908
|
+
</h3><div class="docstring">
|
877
909
|
<div class="discussion">
|
878
910
|
<p>Sort objects into alphabetical strings, used for composing index names correctly (since we always assume they're alphabetical).</p>
|
879
911
|
|
@@ -883,15 +915,17 @@ First, though, delete this object from its old indexes (so the object isn't list
|
|
883
915
|
<div class="tags">
|
884
916
|
|
885
917
|
<div class="examples">
|
886
|
-
<
|
918
|
+
<p class="tag_title">Examples:</p>
|
887
919
|
|
888
|
-
|
889
|
-
|
890
|
-
|
920
|
+
|
921
|
+
<p class="example_title"><div class='inline'><p>find all users by first and last name</p>
|
922
|
+
</div></p>
|
923
|
+
|
924
|
+
<pre class="example code"><code><span class='id identifier rubyid_sort'>sort</span><span class='lparen'>(</span><span class='lbracket'>[</span><span class='symbol'>:gamma</span><span class='comma'>,</span> <span class='symbol'>:alpha</span><span class='comma'>,</span> <span class='symbol'>:beta</span><span class='comma'>,</span> <span class='symbol'>:omega</span><span class='rbracket'>]</span><span class='rparen'>)</span> <span class='comment'># => [:alpha, :beta, :gamma, :omega]</span></code></pre>
|
891
925
|
|
892
926
|
</div>
|
893
927
|
|
894
|
-
<
|
928
|
+
<p class="tag_title">Since:</p>
|
895
929
|
<ul class="since">
|
896
930
|
|
897
931
|
<li>
|
@@ -929,13 +963,15 @@ First, though, delete this object from its old indexes (so the object isn't list
|
|
929
963
|
</div>
|
930
964
|
|
931
965
|
<div class="method_details ">
|
932
|
-
<
|
966
|
+
<h3 class="signature " id="table_name-instance_method">
|
933
967
|
|
934
968
|
- (<tt>Object</tt>) <strong>table_name</strong>
|
935
969
|
|
936
970
|
|
937
971
|
|
938
|
-
|
972
|
+
|
973
|
+
|
974
|
+
</h3><div class="docstring">
|
939
975
|
<div class="discussion">
|
940
976
|
<p>Return the table name for this index.</p>
|
941
977
|
|
@@ -944,7 +980,7 @@ First, though, delete this object from its old indexes (so the object isn't list
|
|
944
980
|
</div>
|
945
981
|
<div class="tags">
|
946
982
|
|
947
|
-
<
|
983
|
+
<p class="tag_title">Since:</p>
|
948
984
|
<ul class="since">
|
949
985
|
|
950
986
|
<li>
|
@@ -974,7 +1010,7 @@ First, though, delete this object from its old indexes (so the object isn't list
|
|
974
1010
|
<pre class="code"><span class="info file"># File 'lib/dynamoid/indexes/index.rb', line 50</span>
|
975
1011
|
|
976
1012
|
<span class='kw'>def</span> <span class='id identifier rubyid_table_name'>table_name</span>
|
977
|
-
<span class='tstring'><span class='tstring_beg'>"</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'>_index_</span><span class='
|
1013
|
+
<span class='tstring'><span class='tstring_beg'>"</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'>_index_</span><span class='tstring_end'>"</span></span> <span class='op'>+</span> <span class='id identifier rubyid_source'>source</span><span class='period'>.</span><span class='id identifier rubyid_table_name'>table_name</span><span class='period'>.</span><span class='id identifier rubyid_sub'>sub</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</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='tstring_end'>"</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_singularize'>singularize</span> <span class='op'>+</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>_</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_name'>name</span><span class='period'>.</span><span class='id identifier rubyid_collect'>collect</span><span class='lparen'>(</span><span class='op'>&</span><span class='symbol'>:to_s</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_collect'>collect</span><span class='lparen'>(</span><span class='op'>&</span><span class='symbol'>:pluralize</span><span class='rparen'>)</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'>_and_</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span><span class='rbrace'>}</span><span class='tstring_end'>"</span></span>
|
978
1014
|
<span class='kw'>end</span></pre>
|
979
1015
|
</td>
|
980
1016
|
</tr>
|
@@ -982,13 +1018,15 @@ First, though, delete this object from its old indexes (so the object isn't list
|
|
982
1018
|
</div>
|
983
1019
|
|
984
1020
|
<div class="method_details ">
|
985
|
-
<
|
1021
|
+
<h3 class="signature " id="values-instance_method">
|
986
1022
|
|
987
1023
|
- (<tt>Hash</tt>) <strong>values</strong>(attrs, changed_attributes = false)
|
988
1024
|
|
989
1025
|
|
990
1026
|
|
991
|
-
|
1027
|
+
|
1028
|
+
|
1029
|
+
</h3><div class="docstring">
|
992
1030
|
<div class="discussion">
|
993
1031
|
<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
1032
|
true to changed_attributes for a list of all the object's dirty attributes in convenient index form (for deleting stale
|
@@ -998,7 +1036,7 @@ information from the indexes).</p>
|
|
998
1036
|
</div>
|
999
1037
|
</div>
|
1000
1038
|
<div class="tags">
|
1001
|
-
<
|
1039
|
+
<p class="tag_title">Parameters:</p>
|
1002
1040
|
<ul class="param">
|
1003
1041
|
|
1004
1042
|
<li>
|
@@ -1018,7 +1056,7 @@ information from the indexes).</p>
|
|
1018
1056
|
|
1019
1057
|
</ul>
|
1020
1058
|
|
1021
|
-
<
|
1059
|
+
<p class="tag_title">Returns:</p>
|
1022
1060
|
<ul class="return">
|
1023
1061
|
|
1024
1062
|
<li>
|
@@ -1035,7 +1073,7 @@ information from the indexes).</p>
|
|
1035
1073
|
</li>
|
1036
1074
|
|
1037
1075
|
</ul>
|
1038
|
-
<
|
1076
|
+
<p class="tag_title">Since:</p>
|
1039
1077
|
<ul class="since">
|
1040
1078
|
|
1041
1079
|
<li>
|
@@ -1093,11 +1131,11 @@ information from the indexes).</p>
|
|
1093
1131
|
</div>
|
1094
1132
|
|
1095
1133
|
</div>
|
1096
|
-
|
1134
|
+
|
1097
1135
|
<div id="footer">
|
1098
|
-
Generated on Thu
|
1136
|
+
Generated on Thu Jun 27 21:59:13 2013 by
|
1099
1137
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
1100
|
-
0.
|
1138
|
+
0.8.6.1 (ruby-1.9.3).
|
1101
1139
|
</div>
|
1102
1140
|
|
1103
1141
|
</body>
|