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,131 @@
|
|
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::Criteria
|
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>
|
38
|
+
»
|
39
|
+
<span class="title">Criteria</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::Criteria
|
60
|
+
|
61
|
+
|
62
|
+
|
63
|
+
</h1>
|
64
|
+
|
65
|
+
<dl class="box">
|
66
|
+
|
67
|
+
|
68
|
+
|
69
|
+
<dt class="r1">Extended by:</dt>
|
70
|
+
<dd class="r1">ActiveSupport::Concern</dd>
|
71
|
+
|
72
|
+
|
73
|
+
|
74
|
+
|
75
|
+
|
76
|
+
|
77
|
+
<dt class="r2">Included in:</dt>
|
78
|
+
<dd class="r2"><span class='object_link'><a href="Components.html" title="Dynamoid::Components (module)">Components</a></span></dd>
|
79
|
+
|
80
|
+
|
81
|
+
|
82
|
+
<dt class="r1 last">Defined in:</dt>
|
83
|
+
<dd class="r1 last">lib/dynamoid/criteria.rb<span class="defines">,<br />
|
84
|
+
lib/dynamoid/criteria/chain.rb</span>
|
85
|
+
</dd>
|
86
|
+
|
87
|
+
</dl>
|
88
|
+
<div class="clear"></div>
|
89
|
+
|
90
|
+
<h2>Overview</h2><div class="docstring">
|
91
|
+
<div class="discussion">
|
92
|
+
<p>Allows classes to be queried by where, all, first, and each and return criteria chains.</p>
|
93
|
+
|
94
|
+
|
95
|
+
</div>
|
96
|
+
</div>
|
97
|
+
<div class="tags">
|
98
|
+
|
99
|
+
|
100
|
+
</div><h2>Defined Under Namespace</h2>
|
101
|
+
<p class="children">
|
102
|
+
|
103
|
+
|
104
|
+
<strong class="modules">Modules:</strong> <span class='object_link'><a href="Criteria/ClassMethods.html" title="Dynamoid::Criteria::ClassMethods (module)">ClassMethods</a></span>
|
105
|
+
|
106
|
+
|
107
|
+
|
108
|
+
<strong class="classes">Classes:</strong> <span class='object_link'><a href="Criteria/Chain.html" title="Dynamoid::Criteria::Chain (class)">Chain</a></span>
|
109
|
+
|
110
|
+
|
111
|
+
</p>
|
112
|
+
|
113
|
+
|
114
|
+
|
115
|
+
|
116
|
+
|
117
|
+
|
118
|
+
|
119
|
+
|
120
|
+
|
121
|
+
|
122
|
+
</div>
|
123
|
+
|
124
|
+
<div id="footer">
|
125
|
+
Generated on Thu Apr 26 01:26:24 2012 by
|
126
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
127
|
+
0.7.5 (ruby-1.9.3).
|
128
|
+
</div>
|
129
|
+
|
130
|
+
</body>
|
131
|
+
</html>
|
@@ -0,0 +1,1063 @@
|
|
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
|
+
Class: Dynamoid::Criteria::Chain
|
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="../Criteria.html" title="Dynamoid::Criteria (module)">Criteria</a></span></span>
|
38
|
+
»
|
39
|
+
<span class="title">Chain</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>Class: Dynamoid::Criteria::Chain
|
60
|
+
|
61
|
+
|
62
|
+
|
63
|
+
</h1>
|
64
|
+
|
65
|
+
<dl class="box">
|
66
|
+
|
67
|
+
<dt class="r1">Inherits:</dt>
|
68
|
+
<dd class="r1">
|
69
|
+
<span class="inheritName">Object</span>
|
70
|
+
|
71
|
+
<ul class="fullTree">
|
72
|
+
<li>Object</li>
|
73
|
+
|
74
|
+
<li class="next">Dynamoid::Criteria::Chain</li>
|
75
|
+
|
76
|
+
</ul>
|
77
|
+
<a href="#" class="inheritanceTree">show all</a>
|
78
|
+
|
79
|
+
</dd>
|
80
|
+
|
81
|
+
|
82
|
+
|
83
|
+
|
84
|
+
|
85
|
+
|
86
|
+
<dt class="r2">Includes:</dt>
|
87
|
+
<dd class="r2">Enumerable</dd>
|
88
|
+
|
89
|
+
|
90
|
+
|
91
|
+
|
92
|
+
|
93
|
+
<dt class="r1 last">Defined in:</dt>
|
94
|
+
<dd class="r1 last">lib/dynamoid/criteria/chain.rb</dd>
|
95
|
+
|
96
|
+
</dl>
|
97
|
+
<div class="clear"></div>
|
98
|
+
|
99
|
+
<h2>Overview</h2><div class="docstring">
|
100
|
+
<div class="discussion">
|
101
|
+
<p>The criteria chain is equivalent to an ActiveRecord relation (and realistically I should change the name from
|
102
|
+
chain to relation). It is a chainable object that builds up a query and eventually executes it either on an index
|
103
|
+
or by a full table scan.</p>
|
104
|
+
|
105
|
+
|
106
|
+
</div>
|
107
|
+
</div>
|
108
|
+
<div class="tags">
|
109
|
+
|
110
|
+
|
111
|
+
</div>
|
112
|
+
|
113
|
+
|
114
|
+
|
115
|
+
<h2>Instance Attribute Summary <small>(<a href="#" class="summary_toggle">collapse</a>)</small></h2>
|
116
|
+
<ul class="summary">
|
117
|
+
|
118
|
+
<li class="public ">
|
119
|
+
<span class="summary_signature">
|
120
|
+
|
121
|
+
<a href="#consistent_read-instance_method" title="#consistent_read (instance method)">- (Object) <strong>consistent_read</strong> </a>
|
122
|
+
|
123
|
+
|
124
|
+
|
125
|
+
</span>
|
126
|
+
|
127
|
+
|
128
|
+
|
129
|
+
|
130
|
+
|
131
|
+
|
132
|
+
|
133
|
+
|
134
|
+
|
135
|
+
|
136
|
+
|
137
|
+
<span class="summary_desc"><div class='inline'><p>Returns the value of attribute consistent_read.</p>
|
138
|
+
</div></span>
|
139
|
+
|
140
|
+
</li>
|
141
|
+
|
142
|
+
|
143
|
+
<li class="public ">
|
144
|
+
<span class="summary_signature">
|
145
|
+
|
146
|
+
<a href="#limit-instance_method" title="#limit (instance method)">- (Object) <strong>limit</strong>(limit) </a>
|
147
|
+
|
148
|
+
|
149
|
+
|
150
|
+
</span>
|
151
|
+
|
152
|
+
|
153
|
+
|
154
|
+
|
155
|
+
|
156
|
+
|
157
|
+
|
158
|
+
|
159
|
+
|
160
|
+
|
161
|
+
|
162
|
+
<span class="summary_desc"><div class='inline'><p>Returns the value of attribute limit.</p>
|
163
|
+
</div></span>
|
164
|
+
|
165
|
+
</li>
|
166
|
+
|
167
|
+
|
168
|
+
<li class="public ">
|
169
|
+
<span class="summary_signature">
|
170
|
+
|
171
|
+
<a href="#query-instance_method" title="#query (instance method)">- (Object) <strong>query</strong> </a>
|
172
|
+
|
173
|
+
|
174
|
+
|
175
|
+
</span>
|
176
|
+
|
177
|
+
|
178
|
+
|
179
|
+
|
180
|
+
|
181
|
+
|
182
|
+
|
183
|
+
|
184
|
+
|
185
|
+
|
186
|
+
|
187
|
+
<span class="summary_desc"><div class='inline'><p>Returns the value of attribute query.</p>
|
188
|
+
</div></span>
|
189
|
+
|
190
|
+
</li>
|
191
|
+
|
192
|
+
|
193
|
+
<li class="public ">
|
194
|
+
<span class="summary_signature">
|
195
|
+
|
196
|
+
<a href="#source-instance_method" title="#source (instance method)">- (Object) <strong>source</strong> </a>
|
197
|
+
|
198
|
+
|
199
|
+
|
200
|
+
</span>
|
201
|
+
|
202
|
+
|
203
|
+
|
204
|
+
|
205
|
+
|
206
|
+
|
207
|
+
|
208
|
+
|
209
|
+
|
210
|
+
|
211
|
+
|
212
|
+
<span class="summary_desc"><div class='inline'><p>Returns the value of attribute source.</p>
|
213
|
+
</div></span>
|
214
|
+
|
215
|
+
</li>
|
216
|
+
|
217
|
+
|
218
|
+
<li class="public ">
|
219
|
+
<span class="summary_signature">
|
220
|
+
|
221
|
+
<a href="#start-instance_method" title="#start (instance method)">- (Object) <strong>start</strong>(start) </a>
|
222
|
+
|
223
|
+
|
224
|
+
|
225
|
+
</span>
|
226
|
+
|
227
|
+
|
228
|
+
|
229
|
+
|
230
|
+
|
231
|
+
|
232
|
+
|
233
|
+
|
234
|
+
|
235
|
+
|
236
|
+
|
237
|
+
<span class="summary_desc"><div class='inline'><p>Returns the value of attribute start.</p>
|
238
|
+
</div></span>
|
239
|
+
|
240
|
+
</li>
|
241
|
+
|
242
|
+
|
243
|
+
<li class="public ">
|
244
|
+
<span class="summary_signature">
|
245
|
+
|
246
|
+
<a href="#values-instance_method" title="#values (instance method)">- (Object) <strong>values</strong> </a>
|
247
|
+
|
248
|
+
|
249
|
+
|
250
|
+
</span>
|
251
|
+
|
252
|
+
|
253
|
+
|
254
|
+
|
255
|
+
|
256
|
+
|
257
|
+
|
258
|
+
|
259
|
+
|
260
|
+
|
261
|
+
|
262
|
+
<span class="summary_desc"><div class='inline'><p>Returns the value of attribute values.</p>
|
263
|
+
</div></span>
|
264
|
+
|
265
|
+
</li>
|
266
|
+
|
267
|
+
|
268
|
+
</ul>
|
269
|
+
|
270
|
+
|
271
|
+
|
272
|
+
|
273
|
+
|
274
|
+
<h2>
|
275
|
+
Instance Method Summary
|
276
|
+
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
|
277
|
+
</h2>
|
278
|
+
|
279
|
+
<ul class="summary">
|
280
|
+
|
281
|
+
<li class="public ">
|
282
|
+
<span class="summary_signature">
|
283
|
+
|
284
|
+
<a href="#all-instance_method" title="#all (instance method)">- (Object) <strong>all</strong> </a>
|
285
|
+
|
286
|
+
|
287
|
+
|
288
|
+
</span>
|
289
|
+
|
290
|
+
|
291
|
+
|
292
|
+
|
293
|
+
|
294
|
+
|
295
|
+
|
296
|
+
|
297
|
+
<span class="summary_desc"><div class='inline'><p>Returns all the records matching the criteria.</p>
|
298
|
+
</div></span>
|
299
|
+
|
300
|
+
</li>
|
301
|
+
|
302
|
+
|
303
|
+
<li class="public ">
|
304
|
+
<span class="summary_signature">
|
305
|
+
|
306
|
+
<a href="#consistent-instance_method" title="#consistent (instance method)">- (Object) <strong>consistent</strong> </a>
|
307
|
+
|
308
|
+
|
309
|
+
|
310
|
+
</span>
|
311
|
+
|
312
|
+
|
313
|
+
|
314
|
+
|
315
|
+
|
316
|
+
|
317
|
+
|
318
|
+
|
319
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
320
|
+
|
321
|
+
</li>
|
322
|
+
|
323
|
+
|
324
|
+
<li class="public ">
|
325
|
+
<span class="summary_signature">
|
326
|
+
|
327
|
+
<a href="#consistent_opts-instance_method" title="#consistent_opts (instance method)">- (Object) <strong>consistent_opts</strong> </a>
|
328
|
+
|
329
|
+
|
330
|
+
|
331
|
+
</span>
|
332
|
+
|
333
|
+
|
334
|
+
|
335
|
+
|
336
|
+
|
337
|
+
|
338
|
+
|
339
|
+
|
340
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
341
|
+
|
342
|
+
</li>
|
343
|
+
|
344
|
+
|
345
|
+
<li class="public ">
|
346
|
+
<span class="summary_signature">
|
347
|
+
|
348
|
+
<a href="#each-instance_method" title="#each (instance method)">- (Object) <strong>each</strong>(&block) </a>
|
349
|
+
|
350
|
+
|
351
|
+
|
352
|
+
</span>
|
353
|
+
|
354
|
+
|
355
|
+
|
356
|
+
|
357
|
+
|
358
|
+
|
359
|
+
|
360
|
+
|
361
|
+
<span class="summary_desc"><div class='inline'><p>Allows you to use the results of a search as an enumerable over the results found.</p>
|
362
|
+
</div></span>
|
363
|
+
|
364
|
+
</li>
|
365
|
+
|
366
|
+
|
367
|
+
<li class="public ">
|
368
|
+
<span class="summary_signature">
|
369
|
+
|
370
|
+
<a href="#first-instance_method" title="#first (instance method)">- (Object) <strong>first</strong> </a>
|
371
|
+
|
372
|
+
|
373
|
+
|
374
|
+
</span>
|
375
|
+
|
376
|
+
|
377
|
+
|
378
|
+
|
379
|
+
|
380
|
+
|
381
|
+
|
382
|
+
|
383
|
+
<span class="summary_desc"><div class='inline'><p>Returns the first record matching the criteria.</p>
|
384
|
+
</div></span>
|
385
|
+
|
386
|
+
</li>
|
387
|
+
|
388
|
+
|
389
|
+
<li class="public ">
|
390
|
+
<span class="summary_signature">
|
391
|
+
|
392
|
+
<a href="#initialize-instance_method" title="#initialize (instance method)">- (Chain) <strong>initialize</strong>(source) </a>
|
393
|
+
|
394
|
+
|
395
|
+
|
396
|
+
</span>
|
397
|
+
|
398
|
+
<span class="note title constructor">constructor</span>
|
399
|
+
|
400
|
+
|
401
|
+
|
402
|
+
|
403
|
+
|
404
|
+
|
405
|
+
|
406
|
+
|
407
|
+
<span class="summary_desc"><div class='inline'><p>Create a new criteria chain.</p>
|
408
|
+
</div></span>
|
409
|
+
|
410
|
+
</li>
|
411
|
+
|
412
|
+
|
413
|
+
<li class="public ">
|
414
|
+
<span class="summary_signature">
|
415
|
+
|
416
|
+
<a href="#where-instance_method" title="#where (instance method)">- (Object) <strong>where</strong>(args) </a>
|
417
|
+
|
418
|
+
|
419
|
+
|
420
|
+
</span>
|
421
|
+
|
422
|
+
|
423
|
+
|
424
|
+
|
425
|
+
|
426
|
+
|
427
|
+
|
428
|
+
|
429
|
+
<span class="summary_desc"><div class='inline'><p>The workhorse method of the criteria chain.</p>
|
430
|
+
</div></span>
|
431
|
+
|
432
|
+
</li>
|
433
|
+
|
434
|
+
|
435
|
+
</ul>
|
436
|
+
|
437
|
+
|
438
|
+
|
439
|
+
<div id="constructor_details" class="method_details_list">
|
440
|
+
<h2>Constructor Details</h2>
|
441
|
+
|
442
|
+
<div class="method_details first">
|
443
|
+
<p class="signature first" id="initialize-instance_method">
|
444
|
+
|
445
|
+
- (<tt><span class='object_link'><a href="" title="Dynamoid::Criteria::Chain (class)">Chain</a></span></tt>) <strong>initialize</strong>(source)
|
446
|
+
|
447
|
+
|
448
|
+
|
449
|
+
</p><div class="docstring">
|
450
|
+
<div class="discussion">
|
451
|
+
<p>Create a new criteria chain.</p>
|
452
|
+
|
453
|
+
|
454
|
+
</div>
|
455
|
+
</div>
|
456
|
+
<div class="tags">
|
457
|
+
<h3>Parameters:</h3>
|
458
|
+
<ul class="param">
|
459
|
+
|
460
|
+
<li>
|
461
|
+
|
462
|
+
<span class='name'>source</span>
|
463
|
+
|
464
|
+
|
465
|
+
<span class='type'>(<tt>Class</tt>)</span>
|
466
|
+
|
467
|
+
|
468
|
+
|
469
|
+
—
|
470
|
+
<div class='inline'><p>the class upon which the ultimate query will be performed.</p>
|
471
|
+
</div>
|
472
|
+
|
473
|
+
</li>
|
474
|
+
|
475
|
+
</ul>
|
476
|
+
|
477
|
+
|
478
|
+
</div><table class="source_code">
|
479
|
+
<tr>
|
480
|
+
<td>
|
481
|
+
<pre class="lines">
|
482
|
+
|
483
|
+
|
484
|
+
15
|
485
|
+
16
|
486
|
+
17
|
487
|
+
18
|
488
|
+
19</pre>
|
489
|
+
</td>
|
490
|
+
<td>
|
491
|
+
<pre class="code"><span class="info file"># File 'lib/dynamoid/criteria/chain.rb', line 15</span>
|
492
|
+
|
493
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_source'>source</span><span class='rparen'>)</span>
|
494
|
+
<span class='ivar'>@query</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
|
495
|
+
<span class='ivar'>@source</span> <span class='op'>=</span> <span class='id identifier rubyid_source'>source</span>
|
496
|
+
<span class='ivar'>@consistent_read</span> <span class='op'>=</span> <span class='kw'>false</span>
|
497
|
+
<span class='kw'>end</span></pre>
|
498
|
+
</td>
|
499
|
+
</tr>
|
500
|
+
</table>
|
501
|
+
</div>
|
502
|
+
|
503
|
+
</div>
|
504
|
+
|
505
|
+
<div id="instance_attr_details" class="attr_details">
|
506
|
+
<h2>Instance Attribute Details</h2>
|
507
|
+
|
508
|
+
|
509
|
+
<span id="consistent_read=-instance_method"></span>
|
510
|
+
<span id="consistent_read-instance_method"></span>
|
511
|
+
<div class="method_details first">
|
512
|
+
<p class="signature first" id="consistent_read-instance_method">
|
513
|
+
|
514
|
+
- (<tt>Object</tt>) <strong>consistent_read</strong>
|
515
|
+
|
516
|
+
|
517
|
+
|
518
|
+
</p><div class="docstring">
|
519
|
+
<div class="discussion">
|
520
|
+
<p>Returns the value of attribute consistent_read</p>
|
521
|
+
|
522
|
+
|
523
|
+
</div>
|
524
|
+
</div>
|
525
|
+
<div class="tags">
|
526
|
+
|
527
|
+
|
528
|
+
</div><table class="source_code">
|
529
|
+
<tr>
|
530
|
+
<td>
|
531
|
+
<pre class="lines">
|
532
|
+
|
533
|
+
|
534
|
+
9
|
535
|
+
10
|
536
|
+
11</pre>
|
537
|
+
</td>
|
538
|
+
<td>
|
539
|
+
<pre class="code"><span class="info file"># File 'lib/dynamoid/criteria/chain.rb', line 9</span>
|
540
|
+
|
541
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_consistent_read'>consistent_read</span>
|
542
|
+
<span class='ivar'>@consistent_read</span>
|
543
|
+
<span class='kw'>end</span></pre>
|
544
|
+
</td>
|
545
|
+
</tr>
|
546
|
+
</table>
|
547
|
+
</div>
|
548
|
+
|
549
|
+
|
550
|
+
<span id="limit=-instance_method"></span>
|
551
|
+
<span id="limit-instance_method"></span>
|
552
|
+
<div class="method_details ">
|
553
|
+
<p class="signature " id="limit-instance_method">
|
554
|
+
|
555
|
+
- (<tt>Object</tt>) <strong>limit</strong>(limit)
|
556
|
+
|
557
|
+
|
558
|
+
|
559
|
+
</p><div class="docstring">
|
560
|
+
<div class="discussion">
|
561
|
+
<p>Returns the value of attribute limit</p>
|
562
|
+
|
563
|
+
|
564
|
+
</div>
|
565
|
+
</div>
|
566
|
+
<div class="tags">
|
567
|
+
|
568
|
+
|
569
|
+
</div><table class="source_code">
|
570
|
+
<tr>
|
571
|
+
<td>
|
572
|
+
<pre class="lines">
|
573
|
+
|
574
|
+
|
575
|
+
9
|
576
|
+
10
|
577
|
+
11
|
578
|
+
12</pre>
|
579
|
+
</td>
|
580
|
+
<td>
|
581
|
+
<pre class="code"><span class="info file"># File 'lib/dynamoid/criteria/chain.rb', line 9</span>
|
582
|
+
|
583
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_limit'>limit</span><span class='lparen'>(</span><span class='id identifier rubyid_limit'>limit</span><span class='rparen'>)</span>
|
584
|
+
<span class='ivar'>@limit</span> <span class='op'>=</span> <span class='id identifier rubyid_limit'>limit</span>
|
585
|
+
<span class='id identifier rubyid_records'>records</span>
|
586
|
+
<span class='kw'>end</span></pre>
|
587
|
+
</td>
|
588
|
+
</tr>
|
589
|
+
</table>
|
590
|
+
</div>
|
591
|
+
|
592
|
+
|
593
|
+
<span id="query=-instance_method"></span>
|
594
|
+
<span id="query-instance_method"></span>
|
595
|
+
<div class="method_details ">
|
596
|
+
<p class="signature " id="query-instance_method">
|
597
|
+
|
598
|
+
- (<tt>Object</tt>) <strong>query</strong>
|
599
|
+
|
600
|
+
|
601
|
+
|
602
|
+
</p><div class="docstring">
|
603
|
+
<div class="discussion">
|
604
|
+
<p>Returns the value of attribute query</p>
|
605
|
+
|
606
|
+
|
607
|
+
</div>
|
608
|
+
</div>
|
609
|
+
<div class="tags">
|
610
|
+
|
611
|
+
|
612
|
+
</div><table class="source_code">
|
613
|
+
<tr>
|
614
|
+
<td>
|
615
|
+
<pre class="lines">
|
616
|
+
|
617
|
+
|
618
|
+
9
|
619
|
+
10
|
620
|
+
11</pre>
|
621
|
+
</td>
|
622
|
+
<td>
|
623
|
+
<pre class="code"><span class="info file"># File 'lib/dynamoid/criteria/chain.rb', line 9</span>
|
624
|
+
|
625
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_query'>query</span>
|
626
|
+
<span class='ivar'>@query</span>
|
627
|
+
<span class='kw'>end</span></pre>
|
628
|
+
</td>
|
629
|
+
</tr>
|
630
|
+
</table>
|
631
|
+
</div>
|
632
|
+
|
633
|
+
|
634
|
+
<span id="source=-instance_method"></span>
|
635
|
+
<span id="source-instance_method"></span>
|
636
|
+
<div class="method_details ">
|
637
|
+
<p class="signature " id="source-instance_method">
|
638
|
+
|
639
|
+
- (<tt>Object</tt>) <strong>source</strong>
|
640
|
+
|
641
|
+
|
642
|
+
|
643
|
+
</p><div class="docstring">
|
644
|
+
<div class="discussion">
|
645
|
+
<p>Returns the value of attribute source</p>
|
646
|
+
|
647
|
+
|
648
|
+
</div>
|
649
|
+
</div>
|
650
|
+
<div class="tags">
|
651
|
+
|
652
|
+
|
653
|
+
</div><table class="source_code">
|
654
|
+
<tr>
|
655
|
+
<td>
|
656
|
+
<pre class="lines">
|
657
|
+
|
658
|
+
|
659
|
+
9
|
660
|
+
10
|
661
|
+
11</pre>
|
662
|
+
</td>
|
663
|
+
<td>
|
664
|
+
<pre class="code"><span class="info file"># File 'lib/dynamoid/criteria/chain.rb', line 9</span>
|
665
|
+
|
666
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_source'>source</span>
|
667
|
+
<span class='ivar'>@source</span>
|
668
|
+
<span class='kw'>end</span></pre>
|
669
|
+
</td>
|
670
|
+
</tr>
|
671
|
+
</table>
|
672
|
+
</div>
|
673
|
+
|
674
|
+
|
675
|
+
<span id="start=-instance_method"></span>
|
676
|
+
<span id="start-instance_method"></span>
|
677
|
+
<div class="method_details ">
|
678
|
+
<p class="signature " id="start-instance_method">
|
679
|
+
|
680
|
+
- (<tt>Object</tt>) <strong>start</strong>(start)
|
681
|
+
|
682
|
+
|
683
|
+
|
684
|
+
</p><div class="docstring">
|
685
|
+
<div class="discussion">
|
686
|
+
<p>Returns the value of attribute start</p>
|
687
|
+
|
688
|
+
|
689
|
+
</div>
|
690
|
+
</div>
|
691
|
+
<div class="tags">
|
692
|
+
|
693
|
+
|
694
|
+
</div><table class="source_code">
|
695
|
+
<tr>
|
696
|
+
<td>
|
697
|
+
<pre class="lines">
|
698
|
+
|
699
|
+
|
700
|
+
9
|
701
|
+
10
|
702
|
+
11
|
703
|
+
12</pre>
|
704
|
+
</td>
|
705
|
+
<td>
|
706
|
+
<pre class="code"><span class="info file"># File 'lib/dynamoid/criteria/chain.rb', line 9</span>
|
707
|
+
|
708
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_start'>start</span><span class='lparen'>(</span><span class='id identifier rubyid_start'>start</span><span class='rparen'>)</span>
|
709
|
+
<span class='ivar'>@start</span> <span class='op'>=</span> <span class='id identifier rubyid_start'>start</span>
|
710
|
+
<span class='kw'>self</span>
|
711
|
+
<span class='kw'>end</span></pre>
|
712
|
+
</td>
|
713
|
+
</tr>
|
714
|
+
</table>
|
715
|
+
</div>
|
716
|
+
|
717
|
+
|
718
|
+
<span id="values=-instance_method"></span>
|
719
|
+
<span id="values-instance_method"></span>
|
720
|
+
<div class="method_details ">
|
721
|
+
<p class="signature " id="values-instance_method">
|
722
|
+
|
723
|
+
- (<tt>Object</tt>) <strong>values</strong>
|
724
|
+
|
725
|
+
|
726
|
+
|
727
|
+
</p><div class="docstring">
|
728
|
+
<div class="discussion">
|
729
|
+
<p>Returns the value of attribute values</p>
|
730
|
+
|
731
|
+
|
732
|
+
</div>
|
733
|
+
</div>
|
734
|
+
<div class="tags">
|
735
|
+
|
736
|
+
|
737
|
+
</div><table class="source_code">
|
738
|
+
<tr>
|
739
|
+
<td>
|
740
|
+
<pre class="lines">
|
741
|
+
|
742
|
+
|
743
|
+
9
|
744
|
+
10
|
745
|
+
11</pre>
|
746
|
+
</td>
|
747
|
+
<td>
|
748
|
+
<pre class="code"><span class="info file"># File 'lib/dynamoid/criteria/chain.rb', line 9</span>
|
749
|
+
|
750
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_values'>values</span>
|
751
|
+
<span class='ivar'>@values</span>
|
752
|
+
<span class='kw'>end</span></pre>
|
753
|
+
</td>
|
754
|
+
</tr>
|
755
|
+
</table>
|
756
|
+
</div>
|
757
|
+
|
758
|
+
</div>
|
759
|
+
|
760
|
+
|
761
|
+
<div id="instance_method_details" class="method_details_list">
|
762
|
+
<h2>Instance Method Details</h2>
|
763
|
+
|
764
|
+
|
765
|
+
<div class="method_details first">
|
766
|
+
<p class="signature first" id="all-instance_method">
|
767
|
+
|
768
|
+
- (<tt>Object</tt>) <strong>all</strong>
|
769
|
+
|
770
|
+
|
771
|
+
|
772
|
+
</p><div class="docstring">
|
773
|
+
<div class="discussion">
|
774
|
+
<p>Returns all the records matching the criteria.</p>
|
775
|
+
|
776
|
+
|
777
|
+
</div>
|
778
|
+
</div>
|
779
|
+
<div class="tags">
|
780
|
+
|
781
|
+
<h3>Since:</h3>
|
782
|
+
<ul class="since">
|
783
|
+
|
784
|
+
<li>
|
785
|
+
|
786
|
+
|
787
|
+
|
788
|
+
|
789
|
+
|
790
|
+
<div class='inline'><p>0.2.0</p>
|
791
|
+
</div>
|
792
|
+
|
793
|
+
</li>
|
794
|
+
|
795
|
+
</ul>
|
796
|
+
|
797
|
+
</div><table class="source_code">
|
798
|
+
<tr>
|
799
|
+
<td>
|
800
|
+
<pre class="lines">
|
801
|
+
|
802
|
+
|
803
|
+
45
|
804
|
+
46
|
805
|
+
47</pre>
|
806
|
+
</td>
|
807
|
+
<td>
|
808
|
+
<pre class="code"><span class="info file"># File 'lib/dynamoid/criteria/chain.rb', line 45</span>
|
809
|
+
|
810
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_all'>all</span>
|
811
|
+
<span class='id identifier rubyid_records'>records</span>
|
812
|
+
<span class='kw'>end</span></pre>
|
813
|
+
</td>
|
814
|
+
</tr>
|
815
|
+
</table>
|
816
|
+
</div>
|
817
|
+
|
818
|
+
<div class="method_details ">
|
819
|
+
<p class="signature " id="consistent-instance_method">
|
820
|
+
|
821
|
+
- (<tt>Object</tt>) <strong>consistent</strong>
|
822
|
+
|
823
|
+
|
824
|
+
|
825
|
+
</p><table class="source_code">
|
826
|
+
<tr>
|
827
|
+
<td>
|
828
|
+
<pre class="lines">
|
829
|
+
|
830
|
+
|
831
|
+
37
|
832
|
+
38
|
833
|
+
39
|
834
|
+
40</pre>
|
835
|
+
</td>
|
836
|
+
<td>
|
837
|
+
<pre class="code"><span class="info file"># File 'lib/dynamoid/criteria/chain.rb', line 37</span>
|
838
|
+
|
839
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_consistent'>consistent</span>
|
840
|
+
<span class='ivar'>@consistent_read</span> <span class='op'>=</span> <span class='kw'>true</span>
|
841
|
+
<span class='kw'>self</span>
|
842
|
+
<span class='kw'>end</span></pre>
|
843
|
+
</td>
|
844
|
+
</tr>
|
845
|
+
</table>
|
846
|
+
</div>
|
847
|
+
|
848
|
+
<div class="method_details ">
|
849
|
+
<p class="signature " id="consistent_opts-instance_method">
|
850
|
+
|
851
|
+
- (<tt>Object</tt>) <strong>consistent_opts</strong>
|
852
|
+
|
853
|
+
|
854
|
+
|
855
|
+
</p><table class="source_code">
|
856
|
+
<tr>
|
857
|
+
<td>
|
858
|
+
<pre class="lines">
|
859
|
+
|
860
|
+
|
861
|
+
73
|
862
|
+
74
|
863
|
+
75</pre>
|
864
|
+
</td>
|
865
|
+
<td>
|
866
|
+
<pre class="code"><span class="info file"># File 'lib/dynamoid/criteria/chain.rb', line 73</span>
|
867
|
+
|
868
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_consistent_opts'>consistent_opts</span>
|
869
|
+
<span class='lbrace'>{</span> <span class='symbol'>:consistent_read</span> <span class='op'>=></span> <span class='id identifier rubyid_consistent_read'>consistent_read</span> <span class='rbrace'>}</span>
|
870
|
+
<span class='kw'>end</span></pre>
|
871
|
+
</td>
|
872
|
+
</tr>
|
873
|
+
</table>
|
874
|
+
</div>
|
875
|
+
|
876
|
+
<div class="method_details ">
|
877
|
+
<p class="signature " id="each-instance_method">
|
878
|
+
|
879
|
+
- (<tt>Object</tt>) <strong>each</strong>(&block)
|
880
|
+
|
881
|
+
|
882
|
+
|
883
|
+
</p><div class="docstring">
|
884
|
+
<div class="discussion">
|
885
|
+
<p>Allows you to use the results of a search as an enumerable over the results found.</p>
|
886
|
+
|
887
|
+
|
888
|
+
</div>
|
889
|
+
</div>
|
890
|
+
<div class="tags">
|
891
|
+
|
892
|
+
<h3>Since:</h3>
|
893
|
+
<ul class="since">
|
894
|
+
|
895
|
+
<li>
|
896
|
+
|
897
|
+
|
898
|
+
|
899
|
+
|
900
|
+
|
901
|
+
<div class='inline'><p>0.2.0</p>
|
902
|
+
</div>
|
903
|
+
|
904
|
+
</li>
|
905
|
+
|
906
|
+
</ul>
|
907
|
+
|
908
|
+
</div><table class="source_code">
|
909
|
+
<tr>
|
910
|
+
<td>
|
911
|
+
<pre class="lines">
|
912
|
+
|
913
|
+
|
914
|
+
69
|
915
|
+
70
|
916
|
+
71</pre>
|
917
|
+
</td>
|
918
|
+
<td>
|
919
|
+
<pre class="code"><span class="info file"># File 'lib/dynamoid/criteria/chain.rb', line 69</span>
|
920
|
+
|
921
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_each'>each</span><span class='lparen'>(</span><span class='op'>&</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
|
922
|
+
<span class='id identifier rubyid_records'>records</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span><span class='lparen'>(</span><span class='op'>&</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
|
923
|
+
<span class='kw'>end</span></pre>
|
924
|
+
</td>
|
925
|
+
</tr>
|
926
|
+
</table>
|
927
|
+
</div>
|
928
|
+
|
929
|
+
<div class="method_details ">
|
930
|
+
<p class="signature " id="first-instance_method">
|
931
|
+
|
932
|
+
- (<tt>Object</tt>) <strong>first</strong>
|
933
|
+
|
934
|
+
|
935
|
+
|
936
|
+
</p><div class="docstring">
|
937
|
+
<div class="discussion">
|
938
|
+
<p>Returns the first record matching the criteria.</p>
|
939
|
+
|
940
|
+
|
941
|
+
</div>
|
942
|
+
</div>
|
943
|
+
<div class="tags">
|
944
|
+
|
945
|
+
<h3>Since:</h3>
|
946
|
+
<ul class="since">
|
947
|
+
|
948
|
+
<li>
|
949
|
+
|
950
|
+
|
951
|
+
|
952
|
+
|
953
|
+
|
954
|
+
<div class='inline'><p>0.2.0</p>
|
955
|
+
</div>
|
956
|
+
|
957
|
+
</li>
|
958
|
+
|
959
|
+
</ul>
|
960
|
+
|
961
|
+
</div><table class="source_code">
|
962
|
+
<tr>
|
963
|
+
<td>
|
964
|
+
<pre class="lines">
|
965
|
+
|
966
|
+
|
967
|
+
52
|
968
|
+
53
|
969
|
+
54</pre>
|
970
|
+
</td>
|
971
|
+
<td>
|
972
|
+
<pre class="code"><span class="info file"># File 'lib/dynamoid/criteria/chain.rb', line 52</span>
|
973
|
+
|
974
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_first'>first</span>
|
975
|
+
<span class='id identifier rubyid_limit'>limit</span><span class='lparen'>(</span><span class='int'>1</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_first'>first</span>
|
976
|
+
<span class='kw'>end</span></pre>
|
977
|
+
</td>
|
978
|
+
</tr>
|
979
|
+
</table>
|
980
|
+
</div>
|
981
|
+
|
982
|
+
<div class="method_details ">
|
983
|
+
<p class="signature " id="where-instance_method">
|
984
|
+
|
985
|
+
- (<tt>Object</tt>) <strong>where</strong>(args)
|
986
|
+
|
987
|
+
|
988
|
+
|
989
|
+
</p><div class="docstring">
|
990
|
+
<div class="discussion">
|
991
|
+
<p>The workhorse method of the criteria chain. Each key in the passed in hash will become another criteria that the
|
992
|
+
ultimate query must match. A key can either be a symbol or a string, and should be an attribute name or
|
993
|
+
an attribute name with a range operator.</p>
|
994
|
+
|
995
|
+
|
996
|
+
</div>
|
997
|
+
</div>
|
998
|
+
<div class="tags">
|
999
|
+
|
1000
|
+
<div class="examples">
|
1001
|
+
<h3>Examples:</h3>
|
1002
|
+
|
1003
|
+
<h4><div class='inline'><p>A simple criteria</p>
|
1004
|
+
</div></h4>
|
1005
|
+
<pre class="example code"><span class='id identifier rubyid_where'>where</span><span class='lparen'>(</span><span class='symbol'>:name</span> <span class='op'>=></span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Josh</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span></pre>
|
1006
|
+
|
1007
|
+
<h4><div class='inline'><p>A more complicated criteria</p>
|
1008
|
+
</div></h4>
|
1009
|
+
<pre class="example code"><span class='id identifier rubyid_where'>where</span><span class='lparen'>(</span><span class='symbol'>:name</span> <span class='op'>=></span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Josh</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>created_at.gt</span><span class='tstring_end'>'</span></span> <span class='op'>=></span> <span class='const'>DateTime</span><span class='period'>.</span><span class='id identifier rubyid_now'>now</span> <span class='op'>-</span> <span class='int'>1</span><span class='period'>.</span><span class='id identifier rubyid_day'>day</span><span class='rparen'>)</span></pre>
|
1010
|
+
|
1011
|
+
</div>
|
1012
|
+
|
1013
|
+
<h3>Since:</h3>
|
1014
|
+
<ul class="since">
|
1015
|
+
|
1016
|
+
<li>
|
1017
|
+
|
1018
|
+
|
1019
|
+
|
1020
|
+
|
1021
|
+
|
1022
|
+
<div class='inline'><p>0.2.0</p>
|
1023
|
+
</div>
|
1024
|
+
|
1025
|
+
</li>
|
1026
|
+
|
1027
|
+
</ul>
|
1028
|
+
|
1029
|
+
</div><table class="source_code">
|
1030
|
+
<tr>
|
1031
|
+
<td>
|
1032
|
+
<pre class="lines">
|
1033
|
+
|
1034
|
+
|
1035
|
+
32
|
1036
|
+
33
|
1037
|
+
34
|
1038
|
+
35</pre>
|
1039
|
+
</td>
|
1040
|
+
<td>
|
1041
|
+
<pre class="code"><span class="info file"># File 'lib/dynamoid/criteria/chain.rb', line 32</span>
|
1042
|
+
|
1043
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_where'>where</span><span class='lparen'>(</span><span class='id identifier rubyid_args'>args</span><span class='rparen'>)</span>
|
1044
|
+
<span class='id identifier rubyid_args'>args</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_k'>k</span><span class='comma'>,</span> <span class='id identifier rubyid_v'>v</span><span class='op'>|</span> <span class='id identifier rubyid_query'>query</span><span class='lbracket'>[</span><span class='id identifier rubyid_k'>k</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_v'>v</span><span class='rbrace'>}</span>
|
1045
|
+
<span class='kw'>self</span>
|
1046
|
+
<span class='kw'>end</span></pre>
|
1047
|
+
</td>
|
1048
|
+
</tr>
|
1049
|
+
</table>
|
1050
|
+
</div>
|
1051
|
+
|
1052
|
+
</div>
|
1053
|
+
|
1054
|
+
</div>
|
1055
|
+
|
1056
|
+
<div id="footer">
|
1057
|
+
Generated on Thu Apr 26 01:26:25 2012 by
|
1058
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
1059
|
+
0.7.5 (ruby-1.9.3).
|
1060
|
+
</div>
|
1061
|
+
|
1062
|
+
</body>
|
1063
|
+
</html>
|