dynamoid-moda 0.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +15 -0
- data/.document +5 -0
- data/.rspec +1 -0
- data/.travis.yml +7 -0
- data/Gemfile +24 -0
- data/Gemfile.lock +118 -0
- data/Gemfile_activemodel4 +24 -0
- data/Gemfile_activemodel4.lock +88 -0
- data/LICENSE.txt +20 -0
- data/README.markdown +360 -0
- data/Rakefile +93 -0
- data/VERSION +1 -0
- data/doc/.nojekyll +0 -0
- data/doc/Dynamoid.html +328 -0
- data/doc/Dynamoid/Adapter.html +1872 -0
- data/doc/Dynamoid/Adapter/AwsSdk.html +2101 -0
- data/doc/Dynamoid/Adapter/Local.html +1574 -0
- data/doc/Dynamoid/Associations.html +138 -0
- data/doc/Dynamoid/Associations/Association.html +847 -0
- data/doc/Dynamoid/Associations/BelongsTo.html +161 -0
- data/doc/Dynamoid/Associations/ClassMethods.html +766 -0
- data/doc/Dynamoid/Associations/HasAndBelongsToMany.html +167 -0
- data/doc/Dynamoid/Associations/HasMany.html +167 -0
- data/doc/Dynamoid/Associations/HasOne.html +161 -0
- data/doc/Dynamoid/Associations/ManyAssociation.html +1684 -0
- data/doc/Dynamoid/Associations/SingleAssociation.html +627 -0
- data/doc/Dynamoid/Components.html +242 -0
- data/doc/Dynamoid/Config.html +412 -0
- data/doc/Dynamoid/Config/Options.html +638 -0
- data/doc/Dynamoid/Criteria.html +138 -0
- data/doc/Dynamoid/Criteria/Chain.html +1471 -0
- data/doc/Dynamoid/Criteria/ClassMethods.html +105 -0
- data/doc/Dynamoid/Dirty.html +424 -0
- data/doc/Dynamoid/Dirty/ClassMethods.html +174 -0
- data/doc/Dynamoid/Document.html +1033 -0
- data/doc/Dynamoid/Document/ClassMethods.html +1116 -0
- data/doc/Dynamoid/Errors.html +125 -0
- data/doc/Dynamoid/Errors/ConditionalCheckFailedException.html +141 -0
- data/doc/Dynamoid/Errors/DocumentNotValid.html +221 -0
- data/doc/Dynamoid/Errors/Error.html +137 -0
- data/doc/Dynamoid/Errors/InvalidField.html +141 -0
- data/doc/Dynamoid/Errors/InvalidQuery.html +131 -0
- data/doc/Dynamoid/Errors/MissingRangeKey.html +141 -0
- data/doc/Dynamoid/Fields.html +686 -0
- data/doc/Dynamoid/Fields/ClassMethods.html +438 -0
- data/doc/Dynamoid/Finders.html +135 -0
- data/doc/Dynamoid/Finders/ClassMethods.html +943 -0
- data/doc/Dynamoid/IdentityMap.html +492 -0
- data/doc/Dynamoid/IdentityMap/ClassMethods.html +534 -0
- data/doc/Dynamoid/Indexes.html +321 -0
- data/doc/Dynamoid/Indexes/ClassMethods.html +369 -0
- data/doc/Dynamoid/Indexes/Index.html +1142 -0
- data/doc/Dynamoid/Middleware.html +115 -0
- data/doc/Dynamoid/Middleware/IdentityMap.html +264 -0
- data/doc/Dynamoid/Persistence.html +892 -0
- data/doc/Dynamoid/Persistence/ClassMethods.html +836 -0
- data/doc/Dynamoid/Validations.html +415 -0
- data/doc/_index.html +506 -0
- data/doc/class_list.html +53 -0
- data/doc/css/common.css +1 -0
- data/doc/css/full_list.css +57 -0
- data/doc/css/style.css +338 -0
- data/doc/file.LICENSE.html +73 -0
- data/doc/file.README.html +416 -0
- data/doc/file_list.html +58 -0
- data/doc/frames.html +28 -0
- data/doc/index.html +416 -0
- data/doc/js/app.js +214 -0
- data/doc/js/full_list.js +178 -0
- data/doc/js/jquery.js +4 -0
- data/doc/method_list.html +1144 -0
- data/doc/top-level-namespace.html +112 -0
- data/dynamoid-moda.gemspec +210 -0
- data/dynamoid.gemspec +208 -0
- data/lib/dynamoid.rb +46 -0
- data/lib/dynamoid/adapter.rb +267 -0
- data/lib/dynamoid/adapter/aws_sdk.rb +309 -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 +37 -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 +326 -0
- data/lib/dynamoid/dirty.rb +47 -0
- data/lib/dynamoid/document.rb +199 -0
- data/lib/dynamoid/errors.rb +28 -0
- data/lib/dynamoid/fields.rb +138 -0
- data/lib/dynamoid/finders.rb +133 -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 +292 -0
- data/lib/dynamoid/validations.rb +36 -0
- data/spec/app/models/address.rb +13 -0
- data/spec/app/models/camel_case.rb +34 -0
- data/spec/app/models/car.rb +6 -0
- data/spec/app/models/magazine.rb +11 -0
- data/spec/app/models/message.rb +9 -0
- data/spec/app/models/nuclear_submarine.rb +5 -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/app/models/vehicle.rb +7 -0
- data/spec/dynamoid/adapter/aws_sdk_spec.rb +376 -0
- data/spec/dynamoid/adapter_spec.rb +155 -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 +210 -0
- data/spec/dynamoid/criteria_spec.rb +75 -0
- data/spec/dynamoid/dirty_spec.rb +57 -0
- data/spec/dynamoid/document_spec.rb +180 -0
- data/spec/dynamoid/fields_spec.rb +156 -0
- data/spec/dynamoid/finders_spec.rb +147 -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 +301 -0
- data/spec/dynamoid/validations_spec.rb +36 -0
- data/spec/dynamoid_spec.rb +14 -0
- data/spec/spec_helper.rb +55 -0
- data/spec/support/with_partitioning.rb +15 -0
- metadata +363 -0
|
@@ -0,0 +1,138 @@
|
|
|
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.8.6.1
|
|
10
|
+
|
|
11
|
+
</title>
|
|
12
|
+
|
|
13
|
+
<link rel="stylesheet" href="../css/style.css" type="text/css" charset="utf-8" />
|
|
14
|
+
|
|
15
|
+
<link rel="stylesheet" href="../css/common.css" type="text/css" charset="utf-8" />
|
|
16
|
+
|
|
17
|
+
<script type="text/javascript" charset="utf-8">
|
|
18
|
+
hasFrames = window.top.frames.main ? true : false;
|
|
19
|
+
relpath = '../';
|
|
20
|
+
framesUrl = "../frames.html#!" + escape(window.location.href);
|
|
21
|
+
</script>
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
<script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
|
|
25
|
+
|
|
26
|
+
<script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
</head>
|
|
30
|
+
<body>
|
|
31
|
+
<div id="header">
|
|
32
|
+
<div id="menu">
|
|
33
|
+
|
|
34
|
+
<a href="../_index.html">Index (C)</a> »
|
|
35
|
+
<span class='title'><span class='object_link'><a href="../Dynamoid.html" title="Dynamoid (module)">Dynamoid</a></span></span>
|
|
36
|
+
»
|
|
37
|
+
<span class="title">Criteria</span>
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
|
41
|
+
</div>
|
|
42
|
+
|
|
43
|
+
<div id="search">
|
|
44
|
+
|
|
45
|
+
<a class="full_list_link" id="class_list_link"
|
|
46
|
+
href="../class_list.html">
|
|
47
|
+
Class List
|
|
48
|
+
</a>
|
|
49
|
+
|
|
50
|
+
<a class="full_list_link" id="method_list_link"
|
|
51
|
+
href="../method_list.html">
|
|
52
|
+
Method List
|
|
53
|
+
</a>
|
|
54
|
+
|
|
55
|
+
<a class="full_list_link" id="file_list_link"
|
|
56
|
+
href="../file_list.html">
|
|
57
|
+
File List
|
|
58
|
+
</a>
|
|
59
|
+
|
|
60
|
+
</div>
|
|
61
|
+
<div class="clear"></div>
|
|
62
|
+
</div>
|
|
63
|
+
|
|
64
|
+
<iframe id="search_frame"></iframe>
|
|
65
|
+
|
|
66
|
+
<div id="content"><h1>Module: Dynamoid::Criteria
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
</h1>
|
|
71
|
+
|
|
72
|
+
<dl class="box">
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
<dt class="r1">Extended by:</dt>
|
|
77
|
+
<dd class="r1">ActiveSupport::Concern</dd>
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
<dt class="r2">Included in:</dt>
|
|
85
|
+
<dd class="r2"><span class='object_link'><a href="Components.html" title="Dynamoid::Components (module)">Components</a></span></dd>
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
<dt class="r1 last">Defined in:</dt>
|
|
90
|
+
<dd class="r1 last">lib/dynamoid/criteria.rb<span class="defines">,<br />
|
|
91
|
+
lib/dynamoid/criteria/chain.rb</span>
|
|
92
|
+
</dd>
|
|
93
|
+
|
|
94
|
+
</dl>
|
|
95
|
+
<div class="clear"></div>
|
|
96
|
+
|
|
97
|
+
<h2>Overview</h2><div class="docstring">
|
|
98
|
+
<div class="discussion">
|
|
99
|
+
<p>Allows classes to be queried by where, all, first, and each and return criteria chains.</p>
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
</div>
|
|
103
|
+
</div>
|
|
104
|
+
<div class="tags">
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
</div><h2>Defined Under Namespace</h2>
|
|
108
|
+
<p class="children">
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
<strong class="modules">Modules:</strong> <span class='object_link'><a href="Criteria/ClassMethods.html" title="Dynamoid::Criteria::ClassMethods (module)">ClassMethods</a></span>
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
<strong class="classes">Classes:</strong> <span class='object_link'><a href="Criteria/Chain.html" title="Dynamoid::Criteria::Chain (class)">Chain</a></span>
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
</p>
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
</div>
|
|
130
|
+
|
|
131
|
+
<div id="footer">
|
|
132
|
+
Generated on Thu Jun 27 21:59:12 2013 by
|
|
133
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
134
|
+
0.8.6.1 (ruby-1.9.3).
|
|
135
|
+
</div>
|
|
136
|
+
|
|
137
|
+
</body>
|
|
138
|
+
</html>
|
|
@@ -0,0 +1,1471 @@
|
|
|
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.8.6.1
|
|
10
|
+
|
|
11
|
+
</title>
|
|
12
|
+
|
|
13
|
+
<link rel="stylesheet" href="../../css/style.css" type="text/css" charset="utf-8" />
|
|
14
|
+
|
|
15
|
+
<link rel="stylesheet" href="../../css/common.css" type="text/css" charset="utf-8" />
|
|
16
|
+
|
|
17
|
+
<script type="text/javascript" charset="utf-8">
|
|
18
|
+
hasFrames = window.top.frames.main ? true : false;
|
|
19
|
+
relpath = '../../';
|
|
20
|
+
framesUrl = "../../frames.html#!" + escape(window.location.href);
|
|
21
|
+
</script>
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
<script type="text/javascript" charset="utf-8" src="../../js/jquery.js"></script>
|
|
25
|
+
|
|
26
|
+
<script type="text/javascript" charset="utf-8" src="../../js/app.js"></script>
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
</head>
|
|
30
|
+
<body>
|
|
31
|
+
<div id="header">
|
|
32
|
+
<div id="menu">
|
|
33
|
+
|
|
34
|
+
<a href="../../_index.html">Index (C)</a> »
|
|
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="../Criteria.html" title="Dynamoid::Criteria (module)">Criteria</a></span></span>
|
|
36
|
+
»
|
|
37
|
+
<span class="title">Chain</span>
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
|
41
|
+
</div>
|
|
42
|
+
|
|
43
|
+
<div id="search">
|
|
44
|
+
|
|
45
|
+
<a class="full_list_link" id="class_list_link"
|
|
46
|
+
href="../../class_list.html">
|
|
47
|
+
Class List
|
|
48
|
+
</a>
|
|
49
|
+
|
|
50
|
+
<a class="full_list_link" id="method_list_link"
|
|
51
|
+
href="../../method_list.html">
|
|
52
|
+
Method List
|
|
53
|
+
</a>
|
|
54
|
+
|
|
55
|
+
<a class="full_list_link" id="file_list_link"
|
|
56
|
+
href="../../file_list.html">
|
|
57
|
+
File List
|
|
58
|
+
</a>
|
|
59
|
+
|
|
60
|
+
</div>
|
|
61
|
+
<div class="clear"></div>
|
|
62
|
+
</div>
|
|
63
|
+
|
|
64
|
+
<iframe id="search_frame"></iframe>
|
|
65
|
+
|
|
66
|
+
<div id="content"><h1>Class: Dynamoid::Criteria::Chain
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
</h1>
|
|
71
|
+
|
|
72
|
+
<dl class="box">
|
|
73
|
+
|
|
74
|
+
<dt class="r1">Inherits:</dt>
|
|
75
|
+
<dd class="r1">
|
|
76
|
+
<span class="inheritName">Object</span>
|
|
77
|
+
|
|
78
|
+
<ul class="fullTree">
|
|
79
|
+
<li>Object</li>
|
|
80
|
+
|
|
81
|
+
<li class="next">Dynamoid::Criteria::Chain</li>
|
|
82
|
+
|
|
83
|
+
</ul>
|
|
84
|
+
<a href="#" class="inheritanceTree">show all</a>
|
|
85
|
+
|
|
86
|
+
</dd>
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
<dt class="r2">Includes:</dt>
|
|
94
|
+
<dd class="r2">Enumerable</dd>
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
<dt class="r1 last">Defined in:</dt>
|
|
101
|
+
<dd class="r1 last">lib/dynamoid/criteria/chain.rb</dd>
|
|
102
|
+
|
|
103
|
+
</dl>
|
|
104
|
+
<div class="clear"></div>
|
|
105
|
+
|
|
106
|
+
<h2>Overview</h2><div class="docstring">
|
|
107
|
+
<div class="discussion">
|
|
108
|
+
<p>The criteria chain is equivalent to an ActiveRecord relation (and realistically I should change the name from
|
|
109
|
+
chain to relation). It is a chainable object that builds up a query and eventually executes it either on an index
|
|
110
|
+
or by a full table scan.</p>
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
</div>
|
|
114
|
+
</div>
|
|
115
|
+
<div class="tags">
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
</div>
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
<h2>Instance Attribute Summary <small>(<a href="#" class="summary_toggle">collapse</a>)</small></h2>
|
|
123
|
+
<ul class="summary">
|
|
124
|
+
|
|
125
|
+
<li class="public ">
|
|
126
|
+
<span class="summary_signature">
|
|
127
|
+
|
|
128
|
+
<a href="#consistent_read-instance_method" title="#consistent_read (instance method)">- (Object) <strong>consistent_read</strong> </a>
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
</span>
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+
<span class="summary_desc"><div class='inline'><p>Returns the value of attribute consistent_read.</p>
|
|
146
|
+
</div></span>
|
|
147
|
+
|
|
148
|
+
</li>
|
|
149
|
+
|
|
150
|
+
|
|
151
|
+
<li class="public ">
|
|
152
|
+
<span class="summary_signature">
|
|
153
|
+
|
|
154
|
+
<a href="#index%3D-instance_method" title="#index= (instance method)">- (Object) <strong>index</strong> </a>
|
|
155
|
+
|
|
156
|
+
|
|
157
|
+
|
|
158
|
+
</span>
|
|
159
|
+
|
|
160
|
+
|
|
161
|
+
|
|
162
|
+
|
|
163
|
+
|
|
164
|
+
<span class="note title writeonly">writeonly</span>
|
|
165
|
+
|
|
166
|
+
|
|
167
|
+
|
|
168
|
+
|
|
169
|
+
|
|
170
|
+
|
|
171
|
+
|
|
172
|
+
|
|
173
|
+
<span class="summary_desc"><div class='inline'><p>Sets the attribute index.</p>
|
|
174
|
+
</div></span>
|
|
175
|
+
|
|
176
|
+
</li>
|
|
177
|
+
|
|
178
|
+
|
|
179
|
+
<li class="public ">
|
|
180
|
+
<span class="summary_signature">
|
|
181
|
+
|
|
182
|
+
<a href="#limit-instance_method" title="#limit (instance method)">- (Object) <strong>limit</strong>(limit) </a>
|
|
183
|
+
|
|
184
|
+
|
|
185
|
+
|
|
186
|
+
</span>
|
|
187
|
+
|
|
188
|
+
|
|
189
|
+
|
|
190
|
+
|
|
191
|
+
|
|
192
|
+
|
|
193
|
+
|
|
194
|
+
|
|
195
|
+
|
|
196
|
+
|
|
197
|
+
|
|
198
|
+
|
|
199
|
+
<span class="summary_desc"><div class='inline'><p>Returns the value of attribute limit.</p>
|
|
200
|
+
</div></span>
|
|
201
|
+
|
|
202
|
+
</li>
|
|
203
|
+
|
|
204
|
+
|
|
205
|
+
<li class="public ">
|
|
206
|
+
<span class="summary_signature">
|
|
207
|
+
|
|
208
|
+
<a href="#query-instance_method" title="#query (instance method)">- (Object) <strong>query</strong> </a>
|
|
209
|
+
|
|
210
|
+
|
|
211
|
+
|
|
212
|
+
</span>
|
|
213
|
+
|
|
214
|
+
|
|
215
|
+
|
|
216
|
+
|
|
217
|
+
|
|
218
|
+
|
|
219
|
+
|
|
220
|
+
|
|
221
|
+
|
|
222
|
+
|
|
223
|
+
|
|
224
|
+
|
|
225
|
+
<span class="summary_desc"><div class='inline'><p>Returns the value of attribute query.</p>
|
|
226
|
+
</div></span>
|
|
227
|
+
|
|
228
|
+
</li>
|
|
229
|
+
|
|
230
|
+
|
|
231
|
+
<li class="public ">
|
|
232
|
+
<span class="summary_signature">
|
|
233
|
+
|
|
234
|
+
<a href="#source-instance_method" title="#source (instance method)">- (Object) <strong>source</strong> </a>
|
|
235
|
+
|
|
236
|
+
|
|
237
|
+
|
|
238
|
+
</span>
|
|
239
|
+
|
|
240
|
+
|
|
241
|
+
|
|
242
|
+
|
|
243
|
+
|
|
244
|
+
|
|
245
|
+
|
|
246
|
+
|
|
247
|
+
|
|
248
|
+
|
|
249
|
+
|
|
250
|
+
|
|
251
|
+
<span class="summary_desc"><div class='inline'><p>Returns the value of attribute source.</p>
|
|
252
|
+
</div></span>
|
|
253
|
+
|
|
254
|
+
</li>
|
|
255
|
+
|
|
256
|
+
|
|
257
|
+
<li class="public ">
|
|
258
|
+
<span class="summary_signature">
|
|
259
|
+
|
|
260
|
+
<a href="#start-instance_method" title="#start (instance method)">- (Object) <strong>start</strong>(start) </a>
|
|
261
|
+
|
|
262
|
+
|
|
263
|
+
|
|
264
|
+
</span>
|
|
265
|
+
|
|
266
|
+
|
|
267
|
+
|
|
268
|
+
|
|
269
|
+
|
|
270
|
+
|
|
271
|
+
|
|
272
|
+
|
|
273
|
+
|
|
274
|
+
|
|
275
|
+
|
|
276
|
+
|
|
277
|
+
<span class="summary_desc"><div class='inline'><p>Returns the value of attribute start.</p>
|
|
278
|
+
</div></span>
|
|
279
|
+
|
|
280
|
+
</li>
|
|
281
|
+
|
|
282
|
+
|
|
283
|
+
<li class="public ">
|
|
284
|
+
<span class="summary_signature">
|
|
285
|
+
|
|
286
|
+
<a href="#values-instance_method" title="#values (instance method)">- (Object) <strong>values</strong> </a>
|
|
287
|
+
|
|
288
|
+
|
|
289
|
+
|
|
290
|
+
</span>
|
|
291
|
+
|
|
292
|
+
|
|
293
|
+
|
|
294
|
+
|
|
295
|
+
|
|
296
|
+
|
|
297
|
+
|
|
298
|
+
|
|
299
|
+
|
|
300
|
+
|
|
301
|
+
|
|
302
|
+
|
|
303
|
+
<span class="summary_desc"><div class='inline'><p>Returns the value of attribute values.</p>
|
|
304
|
+
</div></span>
|
|
305
|
+
|
|
306
|
+
</li>
|
|
307
|
+
|
|
308
|
+
|
|
309
|
+
</ul>
|
|
310
|
+
|
|
311
|
+
|
|
312
|
+
|
|
313
|
+
|
|
314
|
+
|
|
315
|
+
<h2>
|
|
316
|
+
Instance Method Summary
|
|
317
|
+
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
|
|
318
|
+
</h2>
|
|
319
|
+
|
|
320
|
+
<ul class="summary">
|
|
321
|
+
|
|
322
|
+
<li class="public ">
|
|
323
|
+
<span class="summary_signature">
|
|
324
|
+
|
|
325
|
+
<a href="#all-instance_method" title="#all (instance method)">- (Object) <strong>all</strong>(opts = {}) </a>
|
|
326
|
+
|
|
327
|
+
|
|
328
|
+
|
|
329
|
+
</span>
|
|
330
|
+
|
|
331
|
+
|
|
332
|
+
|
|
333
|
+
|
|
334
|
+
|
|
335
|
+
|
|
336
|
+
|
|
337
|
+
|
|
338
|
+
|
|
339
|
+
<span class="summary_desc"><div class='inline'><p>Returns all the records matching the criteria.</p>
|
|
340
|
+
</div></span>
|
|
341
|
+
|
|
342
|
+
</li>
|
|
343
|
+
|
|
344
|
+
|
|
345
|
+
<li class="public ">
|
|
346
|
+
<span class="summary_signature">
|
|
347
|
+
|
|
348
|
+
<a href="#batch-instance_method" title="#batch (instance method)">- (Object) <strong>batch</strong>(batch_size) </a>
|
|
349
|
+
|
|
350
|
+
|
|
351
|
+
|
|
352
|
+
</span>
|
|
353
|
+
|
|
354
|
+
|
|
355
|
+
|
|
356
|
+
|
|
357
|
+
|
|
358
|
+
|
|
359
|
+
|
|
360
|
+
|
|
361
|
+
|
|
362
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
|
363
|
+
|
|
364
|
+
</li>
|
|
365
|
+
|
|
366
|
+
|
|
367
|
+
<li class="public ">
|
|
368
|
+
<span class="summary_signature">
|
|
369
|
+
|
|
370
|
+
<a href="#consistent-instance_method" title="#consistent (instance method)">- (Object) <strong>consistent</strong> </a>
|
|
371
|
+
|
|
372
|
+
|
|
373
|
+
|
|
374
|
+
</span>
|
|
375
|
+
|
|
376
|
+
|
|
377
|
+
|
|
378
|
+
|
|
379
|
+
|
|
380
|
+
|
|
381
|
+
|
|
382
|
+
|
|
383
|
+
|
|
384
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
|
385
|
+
|
|
386
|
+
</li>
|
|
387
|
+
|
|
388
|
+
|
|
389
|
+
<li class="public ">
|
|
390
|
+
<span class="summary_signature">
|
|
391
|
+
|
|
392
|
+
<a href="#consistent_opts-instance_method" title="#consistent_opts (instance method)">- (Object) <strong>consistent_opts</strong> </a>
|
|
393
|
+
|
|
394
|
+
|
|
395
|
+
|
|
396
|
+
</span>
|
|
397
|
+
|
|
398
|
+
|
|
399
|
+
|
|
400
|
+
|
|
401
|
+
|
|
402
|
+
|
|
403
|
+
|
|
404
|
+
|
|
405
|
+
|
|
406
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
|
407
|
+
|
|
408
|
+
</li>
|
|
409
|
+
|
|
410
|
+
|
|
411
|
+
<li class="public ">
|
|
412
|
+
<span class="summary_signature">
|
|
413
|
+
|
|
414
|
+
<a href="#destroy_all-instance_method" title="#destroy_all (instance method)">- (Object) <strong>destroy_all</strong> </a>
|
|
415
|
+
|
|
416
|
+
|
|
417
|
+
|
|
418
|
+
</span>
|
|
419
|
+
|
|
420
|
+
|
|
421
|
+
|
|
422
|
+
|
|
423
|
+
|
|
424
|
+
|
|
425
|
+
|
|
426
|
+
|
|
427
|
+
|
|
428
|
+
<span class="summary_desc"><div class='inline'><p>Destroys all the records matching the criteria.</p>
|
|
429
|
+
</div></span>
|
|
430
|
+
|
|
431
|
+
</li>
|
|
432
|
+
|
|
433
|
+
|
|
434
|
+
<li class="public ">
|
|
435
|
+
<span class="summary_signature">
|
|
436
|
+
|
|
437
|
+
<a href="#each-instance_method" title="#each (instance method)">- (Object) <strong>each</strong>(&block) </a>
|
|
438
|
+
|
|
439
|
+
|
|
440
|
+
|
|
441
|
+
</span>
|
|
442
|
+
|
|
443
|
+
|
|
444
|
+
|
|
445
|
+
|
|
446
|
+
|
|
447
|
+
|
|
448
|
+
|
|
449
|
+
|
|
450
|
+
|
|
451
|
+
<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>
|
|
452
|
+
</div></span>
|
|
453
|
+
|
|
454
|
+
</li>
|
|
455
|
+
|
|
456
|
+
|
|
457
|
+
<li class="public ">
|
|
458
|
+
<span class="summary_signature">
|
|
459
|
+
|
|
460
|
+
<a href="#first-instance_method" title="#first (instance method)">- (Object) <strong>first</strong> </a>
|
|
461
|
+
|
|
462
|
+
|
|
463
|
+
|
|
464
|
+
</span>
|
|
465
|
+
|
|
466
|
+
|
|
467
|
+
|
|
468
|
+
|
|
469
|
+
|
|
470
|
+
|
|
471
|
+
|
|
472
|
+
|
|
473
|
+
|
|
474
|
+
<span class="summary_desc"><div class='inline'><p>Returns the first record matching the criteria.</p>
|
|
475
|
+
</div></span>
|
|
476
|
+
|
|
477
|
+
</li>
|
|
478
|
+
|
|
479
|
+
|
|
480
|
+
<li class="public ">
|
|
481
|
+
<span class="summary_signature">
|
|
482
|
+
|
|
483
|
+
<a href="#initialize-instance_method" title="#initialize (instance method)">- (Chain) <strong>initialize</strong>(source) </a>
|
|
484
|
+
|
|
485
|
+
|
|
486
|
+
|
|
487
|
+
</span>
|
|
488
|
+
|
|
489
|
+
|
|
490
|
+
<span class="note title constructor">constructor</span>
|
|
491
|
+
|
|
492
|
+
|
|
493
|
+
|
|
494
|
+
|
|
495
|
+
|
|
496
|
+
|
|
497
|
+
|
|
498
|
+
|
|
499
|
+
<span class="summary_desc"><div class='inline'><p>Create a new criteria chain.</p>
|
|
500
|
+
</div></span>
|
|
501
|
+
|
|
502
|
+
</li>
|
|
503
|
+
|
|
504
|
+
|
|
505
|
+
<li class="public ">
|
|
506
|
+
<span class="summary_signature">
|
|
507
|
+
|
|
508
|
+
<a href="#scan_index_forward-instance_method" title="#scan_index_forward (instance method)">- (Object) <strong>scan_index_forward</strong>(scan_index_forward) </a>
|
|
509
|
+
|
|
510
|
+
|
|
511
|
+
|
|
512
|
+
</span>
|
|
513
|
+
|
|
514
|
+
|
|
515
|
+
|
|
516
|
+
|
|
517
|
+
|
|
518
|
+
|
|
519
|
+
|
|
520
|
+
|
|
521
|
+
|
|
522
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
|
523
|
+
|
|
524
|
+
</li>
|
|
525
|
+
|
|
526
|
+
|
|
527
|
+
<li class="public ">
|
|
528
|
+
<span class="summary_signature">
|
|
529
|
+
|
|
530
|
+
<a href="#where-instance_method" title="#where (instance method)">- (Object) <strong>where</strong>(args) </a>
|
|
531
|
+
|
|
532
|
+
|
|
533
|
+
|
|
534
|
+
</span>
|
|
535
|
+
|
|
536
|
+
|
|
537
|
+
|
|
538
|
+
|
|
539
|
+
|
|
540
|
+
|
|
541
|
+
|
|
542
|
+
|
|
543
|
+
|
|
544
|
+
<span class="summary_desc"><div class='inline'><p>The workhorse method of the criteria chain.</p>
|
|
545
|
+
</div></span>
|
|
546
|
+
|
|
547
|
+
</li>
|
|
548
|
+
|
|
549
|
+
|
|
550
|
+
</ul>
|
|
551
|
+
|
|
552
|
+
|
|
553
|
+
|
|
554
|
+
<div id="constructor_details" class="method_details_list">
|
|
555
|
+
<h2>Constructor Details</h2>
|
|
556
|
+
|
|
557
|
+
<div class="method_details first">
|
|
558
|
+
<h3 class="signature first" id="initialize-instance_method">
|
|
559
|
+
|
|
560
|
+
- (<tt><span class='object_link'><a href="" title="Dynamoid::Criteria::Chain (class)">Chain</a></span></tt>) <strong>initialize</strong>(source)
|
|
561
|
+
|
|
562
|
+
|
|
563
|
+
|
|
564
|
+
|
|
565
|
+
|
|
566
|
+
</h3><div class="docstring">
|
|
567
|
+
<div class="discussion">
|
|
568
|
+
<p>Create a new criteria chain.</p>
|
|
569
|
+
|
|
570
|
+
|
|
571
|
+
</div>
|
|
572
|
+
</div>
|
|
573
|
+
<div class="tags">
|
|
574
|
+
<p class="tag_title">Parameters:</p>
|
|
575
|
+
<ul class="param">
|
|
576
|
+
|
|
577
|
+
<li>
|
|
578
|
+
|
|
579
|
+
<span class='name'>source</span>
|
|
580
|
+
|
|
581
|
+
|
|
582
|
+
<span class='type'>(<tt>Class</tt>)</span>
|
|
583
|
+
|
|
584
|
+
|
|
585
|
+
|
|
586
|
+
—
|
|
587
|
+
<div class='inline'><p>the class upon which the ultimate query will be performed.</p>
|
|
588
|
+
</div>
|
|
589
|
+
|
|
590
|
+
</li>
|
|
591
|
+
|
|
592
|
+
</ul>
|
|
593
|
+
|
|
594
|
+
|
|
595
|
+
</div><table class="source_code">
|
|
596
|
+
<tr>
|
|
597
|
+
<td>
|
|
598
|
+
<pre class="lines">
|
|
599
|
+
|
|
600
|
+
|
|
601
|
+
15
|
|
602
|
+
16
|
|
603
|
+
17
|
|
604
|
+
18
|
|
605
|
+
19
|
|
606
|
+
20</pre>
|
|
607
|
+
</td>
|
|
608
|
+
<td>
|
|
609
|
+
<pre class="code"><span class="info file"># File 'lib/dynamoid/criteria/chain.rb', line 15</span>
|
|
610
|
+
|
|
611
|
+
<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>
|
|
612
|
+
<span class='ivar'>@query</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
|
|
613
|
+
<span class='ivar'>@source</span> <span class='op'>=</span> <span class='id identifier rubyid_source'>source</span>
|
|
614
|
+
<span class='ivar'>@consistent_read</span> <span class='op'>=</span> <span class='kw'>false</span>
|
|
615
|
+
<span class='ivar'>@scan_index_forward</span> <span class='op'>=</span> <span class='kw'>true</span>
|
|
616
|
+
<span class='kw'>end</span></pre>
|
|
617
|
+
</td>
|
|
618
|
+
</tr>
|
|
619
|
+
</table>
|
|
620
|
+
</div>
|
|
621
|
+
|
|
622
|
+
</div>
|
|
623
|
+
|
|
624
|
+
<div id="instance_attr_details" class="attr_details">
|
|
625
|
+
<h2>Instance Attribute Details</h2>
|
|
626
|
+
|
|
627
|
+
|
|
628
|
+
<span id="consistent_read=-instance_method"></span>
|
|
629
|
+
<div class="method_details first">
|
|
630
|
+
<h3 class="signature first" id="consistent_read-instance_method">
|
|
631
|
+
|
|
632
|
+
- (<tt>Object</tt>) <strong>consistent_read</strong>
|
|
633
|
+
|
|
634
|
+
|
|
635
|
+
|
|
636
|
+
|
|
637
|
+
|
|
638
|
+
</h3><div class="docstring">
|
|
639
|
+
<div class="discussion">
|
|
640
|
+
<p>Returns the value of attribute consistent_read</p>
|
|
641
|
+
|
|
642
|
+
|
|
643
|
+
</div>
|
|
644
|
+
</div>
|
|
645
|
+
<div class="tags">
|
|
646
|
+
|
|
647
|
+
|
|
648
|
+
</div><table class="source_code">
|
|
649
|
+
<tr>
|
|
650
|
+
<td>
|
|
651
|
+
<pre class="lines">
|
|
652
|
+
|
|
653
|
+
|
|
654
|
+
9
|
|
655
|
+
10
|
|
656
|
+
11</pre>
|
|
657
|
+
</td>
|
|
658
|
+
<td>
|
|
659
|
+
<pre class="code"><span class="info file"># File 'lib/dynamoid/criteria/chain.rb', line 9</span>
|
|
660
|
+
|
|
661
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_consistent_read'>consistent_read</span>
|
|
662
|
+
<span class='ivar'>@consistent_read</span>
|
|
663
|
+
<span class='kw'>end</span></pre>
|
|
664
|
+
</td>
|
|
665
|
+
</tr>
|
|
666
|
+
</table>
|
|
667
|
+
</div>
|
|
668
|
+
|
|
669
|
+
|
|
670
|
+
<span id="index-instance_method"></span>
|
|
671
|
+
<div class="method_details ">
|
|
672
|
+
<h3 class="signature " id="index=-instance_method">
|
|
673
|
+
|
|
674
|
+
- (<tt>Object</tt>) <strong>index=</strong>(value)
|
|
675
|
+
|
|
676
|
+
|
|
677
|
+
|
|
678
|
+
|
|
679
|
+
|
|
680
|
+
</h3><div class="docstring">
|
|
681
|
+
<div class="discussion">
|
|
682
|
+
<p>Sets the attribute index</p>
|
|
683
|
+
|
|
684
|
+
|
|
685
|
+
</div>
|
|
686
|
+
</div>
|
|
687
|
+
<div class="tags">
|
|
688
|
+
<p class="tag_title">Parameters:</p>
|
|
689
|
+
<ul class="param">
|
|
690
|
+
|
|
691
|
+
<li>
|
|
692
|
+
|
|
693
|
+
<span class='name'>value</span>
|
|
694
|
+
|
|
695
|
+
|
|
696
|
+
<span class='type'></span>
|
|
697
|
+
|
|
698
|
+
|
|
699
|
+
|
|
700
|
+
—
|
|
701
|
+
<div class='inline'><p>the value to set the attribute index to.</p>
|
|
702
|
+
</div>
|
|
703
|
+
|
|
704
|
+
</li>
|
|
705
|
+
|
|
706
|
+
</ul>
|
|
707
|
+
|
|
708
|
+
|
|
709
|
+
</div><table class="source_code">
|
|
710
|
+
<tr>
|
|
711
|
+
<td>
|
|
712
|
+
<pre class="lines">
|
|
713
|
+
|
|
714
|
+
|
|
715
|
+
9
|
|
716
|
+
10
|
|
717
|
+
11</pre>
|
|
718
|
+
</td>
|
|
719
|
+
<td>
|
|
720
|
+
<pre class="code"><span class="info file"># File 'lib/dynamoid/criteria/chain.rb', line 9</span>
|
|
721
|
+
|
|
722
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_index='>index=</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span>
|
|
723
|
+
<span class='ivar'>@index</span> <span class='op'>=</span> <span class='id identifier rubyid_value'>value</span>
|
|
724
|
+
<span class='kw'>end</span></pre>
|
|
725
|
+
</td>
|
|
726
|
+
</tr>
|
|
727
|
+
</table>
|
|
728
|
+
</div>
|
|
729
|
+
|
|
730
|
+
|
|
731
|
+
<span id="limit=-instance_method"></span>
|
|
732
|
+
<div class="method_details ">
|
|
733
|
+
<h3 class="signature " id="limit-instance_method">
|
|
734
|
+
|
|
735
|
+
- (<tt>Object</tt>) <strong>limit</strong>(limit)
|
|
736
|
+
|
|
737
|
+
|
|
738
|
+
|
|
739
|
+
|
|
740
|
+
|
|
741
|
+
</h3><div class="docstring">
|
|
742
|
+
<div class="discussion">
|
|
743
|
+
<p>Returns the value of attribute limit</p>
|
|
744
|
+
|
|
745
|
+
|
|
746
|
+
</div>
|
|
747
|
+
</div>
|
|
748
|
+
<div class="tags">
|
|
749
|
+
|
|
750
|
+
|
|
751
|
+
</div><table class="source_code">
|
|
752
|
+
<tr>
|
|
753
|
+
<td>
|
|
754
|
+
<pre class="lines">
|
|
755
|
+
|
|
756
|
+
|
|
757
|
+
9
|
|
758
|
+
10
|
|
759
|
+
11</pre>
|
|
760
|
+
</td>
|
|
761
|
+
<td>
|
|
762
|
+
<pre class="code"><span class="info file"># File 'lib/dynamoid/criteria/chain.rb', line 9</span>
|
|
763
|
+
|
|
764
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_limit'>limit</span>
|
|
765
|
+
<span class='ivar'>@limit</span>
|
|
766
|
+
<span class='kw'>end</span></pre>
|
|
767
|
+
</td>
|
|
768
|
+
</tr>
|
|
769
|
+
</table>
|
|
770
|
+
</div>
|
|
771
|
+
|
|
772
|
+
|
|
773
|
+
<span id="query=-instance_method"></span>
|
|
774
|
+
<div class="method_details ">
|
|
775
|
+
<h3 class="signature " id="query-instance_method">
|
|
776
|
+
|
|
777
|
+
- (<tt>Object</tt>) <strong>query</strong>
|
|
778
|
+
|
|
779
|
+
|
|
780
|
+
|
|
781
|
+
|
|
782
|
+
|
|
783
|
+
</h3><div class="docstring">
|
|
784
|
+
<div class="discussion">
|
|
785
|
+
<p>Returns the value of attribute query</p>
|
|
786
|
+
|
|
787
|
+
|
|
788
|
+
</div>
|
|
789
|
+
</div>
|
|
790
|
+
<div class="tags">
|
|
791
|
+
|
|
792
|
+
|
|
793
|
+
</div><table class="source_code">
|
|
794
|
+
<tr>
|
|
795
|
+
<td>
|
|
796
|
+
<pre class="lines">
|
|
797
|
+
|
|
798
|
+
|
|
799
|
+
9
|
|
800
|
+
10
|
|
801
|
+
11</pre>
|
|
802
|
+
</td>
|
|
803
|
+
<td>
|
|
804
|
+
<pre class="code"><span class="info file"># File 'lib/dynamoid/criteria/chain.rb', line 9</span>
|
|
805
|
+
|
|
806
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_query'>query</span>
|
|
807
|
+
<span class='ivar'>@query</span>
|
|
808
|
+
<span class='kw'>end</span></pre>
|
|
809
|
+
</td>
|
|
810
|
+
</tr>
|
|
811
|
+
</table>
|
|
812
|
+
</div>
|
|
813
|
+
|
|
814
|
+
|
|
815
|
+
<span id="source=-instance_method"></span>
|
|
816
|
+
<div class="method_details ">
|
|
817
|
+
<h3 class="signature " id="source-instance_method">
|
|
818
|
+
|
|
819
|
+
- (<tt>Object</tt>) <strong>source</strong>
|
|
820
|
+
|
|
821
|
+
|
|
822
|
+
|
|
823
|
+
|
|
824
|
+
|
|
825
|
+
</h3><div class="docstring">
|
|
826
|
+
<div class="discussion">
|
|
827
|
+
<p>Returns the value of attribute source</p>
|
|
828
|
+
|
|
829
|
+
|
|
830
|
+
</div>
|
|
831
|
+
</div>
|
|
832
|
+
<div class="tags">
|
|
833
|
+
|
|
834
|
+
|
|
835
|
+
</div><table class="source_code">
|
|
836
|
+
<tr>
|
|
837
|
+
<td>
|
|
838
|
+
<pre class="lines">
|
|
839
|
+
|
|
840
|
+
|
|
841
|
+
9
|
|
842
|
+
10
|
|
843
|
+
11</pre>
|
|
844
|
+
</td>
|
|
845
|
+
<td>
|
|
846
|
+
<pre class="code"><span class="info file"># File 'lib/dynamoid/criteria/chain.rb', line 9</span>
|
|
847
|
+
|
|
848
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_source'>source</span>
|
|
849
|
+
<span class='ivar'>@source</span>
|
|
850
|
+
<span class='kw'>end</span></pre>
|
|
851
|
+
</td>
|
|
852
|
+
</tr>
|
|
853
|
+
</table>
|
|
854
|
+
</div>
|
|
855
|
+
|
|
856
|
+
|
|
857
|
+
<span id="start=-instance_method"></span>
|
|
858
|
+
<div class="method_details ">
|
|
859
|
+
<h3 class="signature " id="start-instance_method">
|
|
860
|
+
|
|
861
|
+
- (<tt>Object</tt>) <strong>start</strong>(start)
|
|
862
|
+
|
|
863
|
+
|
|
864
|
+
|
|
865
|
+
|
|
866
|
+
|
|
867
|
+
</h3><div class="docstring">
|
|
868
|
+
<div class="discussion">
|
|
869
|
+
<p>Returns the value of attribute start</p>
|
|
870
|
+
|
|
871
|
+
|
|
872
|
+
</div>
|
|
873
|
+
</div>
|
|
874
|
+
<div class="tags">
|
|
875
|
+
|
|
876
|
+
|
|
877
|
+
</div><table class="source_code">
|
|
878
|
+
<tr>
|
|
879
|
+
<td>
|
|
880
|
+
<pre class="lines">
|
|
881
|
+
|
|
882
|
+
|
|
883
|
+
9
|
|
884
|
+
10
|
|
885
|
+
11</pre>
|
|
886
|
+
</td>
|
|
887
|
+
<td>
|
|
888
|
+
<pre class="code"><span class="info file"># File 'lib/dynamoid/criteria/chain.rb', line 9</span>
|
|
889
|
+
|
|
890
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_start'>start</span>
|
|
891
|
+
<span class='ivar'>@start</span>
|
|
892
|
+
<span class='kw'>end</span></pre>
|
|
893
|
+
</td>
|
|
894
|
+
</tr>
|
|
895
|
+
</table>
|
|
896
|
+
</div>
|
|
897
|
+
|
|
898
|
+
|
|
899
|
+
<span id="values=-instance_method"></span>
|
|
900
|
+
<div class="method_details ">
|
|
901
|
+
<h3 class="signature " id="values-instance_method">
|
|
902
|
+
|
|
903
|
+
- (<tt>Object</tt>) <strong>values</strong>
|
|
904
|
+
|
|
905
|
+
|
|
906
|
+
|
|
907
|
+
|
|
908
|
+
|
|
909
|
+
</h3><div class="docstring">
|
|
910
|
+
<div class="discussion">
|
|
911
|
+
<p>Returns the value of attribute values</p>
|
|
912
|
+
|
|
913
|
+
|
|
914
|
+
</div>
|
|
915
|
+
</div>
|
|
916
|
+
<div class="tags">
|
|
917
|
+
|
|
918
|
+
|
|
919
|
+
</div><table class="source_code">
|
|
920
|
+
<tr>
|
|
921
|
+
<td>
|
|
922
|
+
<pre class="lines">
|
|
923
|
+
|
|
924
|
+
|
|
925
|
+
9
|
|
926
|
+
10
|
|
927
|
+
11</pre>
|
|
928
|
+
</td>
|
|
929
|
+
<td>
|
|
930
|
+
<pre class="code"><span class="info file"># File 'lib/dynamoid/criteria/chain.rb', line 9</span>
|
|
931
|
+
|
|
932
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_values'>values</span>
|
|
933
|
+
<span class='ivar'>@values</span>
|
|
934
|
+
<span class='kw'>end</span></pre>
|
|
935
|
+
</td>
|
|
936
|
+
</tr>
|
|
937
|
+
</table>
|
|
938
|
+
</div>
|
|
939
|
+
|
|
940
|
+
</div>
|
|
941
|
+
|
|
942
|
+
|
|
943
|
+
<div id="instance_method_details" class="method_details_list">
|
|
944
|
+
<h2>Instance Method Details</h2>
|
|
945
|
+
|
|
946
|
+
|
|
947
|
+
<div class="method_details first">
|
|
948
|
+
<h3 class="signature first" id="all-instance_method">
|
|
949
|
+
|
|
950
|
+
- (<tt>Object</tt>) <strong>all</strong>(opts = {})
|
|
951
|
+
|
|
952
|
+
|
|
953
|
+
|
|
954
|
+
|
|
955
|
+
|
|
956
|
+
</h3><div class="docstring">
|
|
957
|
+
<div class="discussion">
|
|
958
|
+
<p>Returns all the records matching the criteria.</p>
|
|
959
|
+
|
|
960
|
+
|
|
961
|
+
</div>
|
|
962
|
+
</div>
|
|
963
|
+
<div class="tags">
|
|
964
|
+
|
|
965
|
+
<p class="tag_title">Since:</p>
|
|
966
|
+
<ul class="since">
|
|
967
|
+
|
|
968
|
+
<li>
|
|
969
|
+
|
|
970
|
+
|
|
971
|
+
|
|
972
|
+
|
|
973
|
+
|
|
974
|
+
<div class='inline'><p>0.2.0</p>
|
|
975
|
+
</div>
|
|
976
|
+
|
|
977
|
+
</li>
|
|
978
|
+
|
|
979
|
+
</ul>
|
|
980
|
+
|
|
981
|
+
</div><table class="source_code">
|
|
982
|
+
<tr>
|
|
983
|
+
<td>
|
|
984
|
+
<pre class="lines">
|
|
985
|
+
|
|
986
|
+
|
|
987
|
+
46
|
|
988
|
+
47
|
|
989
|
+
48
|
|
990
|
+
49</pre>
|
|
991
|
+
</td>
|
|
992
|
+
<td>
|
|
993
|
+
<pre class="code"><span class="info file"># File 'lib/dynamoid/criteria/chain.rb', line 46</span>
|
|
994
|
+
|
|
995
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_all'>all</span><span class='lparen'>(</span><span class='id identifier rubyid_opts'>opts</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
|
|
996
|
+
<span class='id identifier rubyid_batch'>batch</span> <span class='id identifier rubyid_opts'>opts</span><span class='lbracket'>[</span><span class='symbol'>:batch_size</span><span class='rbracket'>]</span> <span class='kw'>if</span> <span class='id identifier rubyid_opts'>opts</span><span class='period'>.</span><span class='id identifier rubyid_has_key?'>has_key?</span> <span class='symbol'>:batch_size</span>
|
|
997
|
+
<span class='id identifier rubyid_records'>records</span>
|
|
998
|
+
<span class='kw'>end</span></pre>
|
|
999
|
+
</td>
|
|
1000
|
+
</tr>
|
|
1001
|
+
</table>
|
|
1002
|
+
</div>
|
|
1003
|
+
|
|
1004
|
+
<div class="method_details ">
|
|
1005
|
+
<h3 class="signature " id="batch-instance_method">
|
|
1006
|
+
|
|
1007
|
+
- (<tt>Object</tt>) <strong>batch</strong>(batch_size)
|
|
1008
|
+
|
|
1009
|
+
|
|
1010
|
+
|
|
1011
|
+
|
|
1012
|
+
|
|
1013
|
+
</h3><table class="source_code">
|
|
1014
|
+
<tr>
|
|
1015
|
+
<td>
|
|
1016
|
+
<pre class="lines">
|
|
1017
|
+
|
|
1018
|
+
|
|
1019
|
+
120
|
|
1020
|
+
121
|
|
1021
|
+
122
|
|
1022
|
+
123
|
|
1023
|
+
124</pre>
|
|
1024
|
+
</td>
|
|
1025
|
+
<td>
|
|
1026
|
+
<pre class="code"><span class="info file"># File 'lib/dynamoid/criteria/chain.rb', line 120</span>
|
|
1027
|
+
|
|
1028
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_batch'>batch</span><span class='lparen'>(</span><span class='id identifier rubyid_batch_size'>batch_size</span><span class='rparen'>)</span>
|
|
1029
|
+
<span class='id identifier rubyid_raise'>raise</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Cannot batch calls when using partitioning</span><span class='tstring_end'>'</span></span> <span class='kw'>if</span> <span class='const'>Dynamoid</span><span class='op'>::</span><span class='const'>Config</span><span class='period'>.</span><span class='id identifier rubyid_partitioning?'>partitioning?</span>
|
|
1030
|
+
<span class='ivar'>@batch_size</span> <span class='op'>=</span> <span class='id identifier rubyid_batch_size'>batch_size</span>
|
|
1031
|
+
<span class='kw'>self</span>
|
|
1032
|
+
<span class='kw'>end</span></pre>
|
|
1033
|
+
</td>
|
|
1034
|
+
</tr>
|
|
1035
|
+
</table>
|
|
1036
|
+
</div>
|
|
1037
|
+
|
|
1038
|
+
<div class="method_details ">
|
|
1039
|
+
<h3 class="signature " id="consistent-instance_method">
|
|
1040
|
+
|
|
1041
|
+
- (<tt>Object</tt>) <strong>consistent</strong>
|
|
1042
|
+
|
|
1043
|
+
|
|
1044
|
+
|
|
1045
|
+
|
|
1046
|
+
|
|
1047
|
+
</h3><table class="source_code">
|
|
1048
|
+
<tr>
|
|
1049
|
+
<td>
|
|
1050
|
+
<pre class="lines">
|
|
1051
|
+
|
|
1052
|
+
|
|
1053
|
+
38
|
|
1054
|
+
39
|
|
1055
|
+
40
|
|
1056
|
+
41</pre>
|
|
1057
|
+
</td>
|
|
1058
|
+
<td>
|
|
1059
|
+
<pre class="code"><span class="info file"># File 'lib/dynamoid/criteria/chain.rb', line 38</span>
|
|
1060
|
+
|
|
1061
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_consistent'>consistent</span>
|
|
1062
|
+
<span class='ivar'>@consistent_read</span> <span class='op'>=</span> <span class='kw'>true</span>
|
|
1063
|
+
<span class='kw'>self</span>
|
|
1064
|
+
<span class='kw'>end</span></pre>
|
|
1065
|
+
</td>
|
|
1066
|
+
</tr>
|
|
1067
|
+
</table>
|
|
1068
|
+
</div>
|
|
1069
|
+
|
|
1070
|
+
<div class="method_details ">
|
|
1071
|
+
<h3 class="signature " id="consistent_opts-instance_method">
|
|
1072
|
+
|
|
1073
|
+
- (<tt>Object</tt>) <strong>consistent_opts</strong>
|
|
1074
|
+
|
|
1075
|
+
|
|
1076
|
+
|
|
1077
|
+
|
|
1078
|
+
|
|
1079
|
+
</h3><table class="source_code">
|
|
1080
|
+
<tr>
|
|
1081
|
+
<td>
|
|
1082
|
+
<pre class="lines">
|
|
1083
|
+
|
|
1084
|
+
|
|
1085
|
+
143
|
|
1086
|
+
144
|
|
1087
|
+
145</pre>
|
|
1088
|
+
</td>
|
|
1089
|
+
<td>
|
|
1090
|
+
<pre class="code"><span class="info file"># File 'lib/dynamoid/criteria/chain.rb', line 143</span>
|
|
1091
|
+
|
|
1092
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_consistent_opts'>consistent_opts</span>
|
|
1093
|
+
<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>
|
|
1094
|
+
<span class='kw'>end</span></pre>
|
|
1095
|
+
</td>
|
|
1096
|
+
</tr>
|
|
1097
|
+
</table>
|
|
1098
|
+
</div>
|
|
1099
|
+
|
|
1100
|
+
<div class="method_details ">
|
|
1101
|
+
<h3 class="signature " id="destroy_all-instance_method">
|
|
1102
|
+
|
|
1103
|
+
- (<tt>Object</tt>) <strong>destroy_all</strong>
|
|
1104
|
+
|
|
1105
|
+
|
|
1106
|
+
|
|
1107
|
+
|
|
1108
|
+
|
|
1109
|
+
</h3><div class="docstring">
|
|
1110
|
+
<div class="discussion">
|
|
1111
|
+
<p>Destroys all the records matching the criteria.</p>
|
|
1112
|
+
|
|
1113
|
+
|
|
1114
|
+
</div>
|
|
1115
|
+
</div>
|
|
1116
|
+
<div class="tags">
|
|
1117
|
+
|
|
1118
|
+
|
|
1119
|
+
</div><table class="source_code">
|
|
1120
|
+
<tr>
|
|
1121
|
+
<td>
|
|
1122
|
+
<pre class="lines">
|
|
1123
|
+
|
|
1124
|
+
|
|
1125
|
+
53
|
|
1126
|
+
54
|
|
1127
|
+
55
|
|
1128
|
+
56
|
|
1129
|
+
57
|
|
1130
|
+
58
|
|
1131
|
+
59
|
|
1132
|
+
60
|
|
1133
|
+
61
|
|
1134
|
+
62
|
|
1135
|
+
63
|
|
1136
|
+
64
|
|
1137
|
+
65
|
|
1138
|
+
66
|
|
1139
|
+
67
|
|
1140
|
+
68
|
|
1141
|
+
69
|
|
1142
|
+
70
|
|
1143
|
+
71
|
|
1144
|
+
72
|
|
1145
|
+
73
|
|
1146
|
+
74
|
|
1147
|
+
75
|
|
1148
|
+
76
|
|
1149
|
+
77
|
|
1150
|
+
78
|
|
1151
|
+
79
|
|
1152
|
+
80
|
|
1153
|
+
81
|
|
1154
|
+
82
|
|
1155
|
+
83
|
|
1156
|
+
84
|
|
1157
|
+
85
|
|
1158
|
+
86
|
|
1159
|
+
87
|
|
1160
|
+
88
|
|
1161
|
+
89
|
|
1162
|
+
90
|
|
1163
|
+
91
|
|
1164
|
+
92
|
|
1165
|
+
93
|
|
1166
|
+
94
|
|
1167
|
+
95
|
|
1168
|
+
96
|
|
1169
|
+
97
|
|
1170
|
+
98
|
|
1171
|
+
99
|
|
1172
|
+
100
|
|
1173
|
+
101
|
|
1174
|
+
102
|
|
1175
|
+
103
|
|
1176
|
+
104
|
|
1177
|
+
105
|
|
1178
|
+
106</pre>
|
|
1179
|
+
</td>
|
|
1180
|
+
<td>
|
|
1181
|
+
<pre class="code"><span class="info file"># File 'lib/dynamoid/criteria/chain.rb', line 53</span>
|
|
1182
|
+
|
|
1183
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_destroy_all'>destroy_all</span>
|
|
1184
|
+
<span class='id identifier rubyid_ids'>ids</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
|
|
1185
|
+
|
|
1186
|
+
<span class='kw'>if</span> <span class='id identifier rubyid_range?'>range?</span>
|
|
1187
|
+
<span class='id identifier rubyid_ranges'>ranges</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
|
|
1188
|
+
<span class='const'>Dynamoid</span><span class='op'>::</span><span class='const'>Adapter</span><span class='period'>.</span><span class='id identifier rubyid_query'>query</span><span class='lparen'>(</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='comma'>,</span> <span class='id identifier rubyid_range_query'>range_query</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_collect'>collect</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_hash'>hash</span><span class='op'>|</span>
|
|
1189
|
+
<span class='id identifier rubyid_ids'>ids</span> <span class='op'><<</span> <span class='id identifier rubyid_hash'>hash</span><span class='lbracket'>[</span><span class='id identifier rubyid_source'>source</span><span class='period'>.</span><span class='id identifier rubyid_hash_key'>hash_key</span><span class='period'>.</span><span class='id identifier rubyid_to_sym'>to_sym</span><span class='rbracket'>]</span>
|
|
1190
|
+
<span class='id identifier rubyid_ranges'>ranges</span> <span class='op'><<</span> <span class='id identifier rubyid_hash'>hash</span><span class='lbracket'>[</span><span class='id identifier rubyid_source'>source</span><span class='period'>.</span><span class='id identifier rubyid_range_key'>range_key</span><span class='period'>.</span><span class='id identifier rubyid_to_sym'>to_sym</span><span class='rbracket'>]</span>
|
|
1191
|
+
<span class='kw'>end</span>
|
|
1192
|
+
|
|
1193
|
+
<span class='const'>Dynamoid</span><span class='op'>::</span><span class='const'>Adapter</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</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='comma'>,</span> <span class='id identifier rubyid_ids'>ids</span><span class='comma'>,</span><span class='lbrace'>{</span><span class='symbol'>:range_key</span> <span class='op'>=></span> <span class='id identifier rubyid_ranges'>ranges</span><span class='rbrace'>}</span><span class='rparen'>)</span>
|
|
1194
|
+
<span class='kw'>elsif</span> <span class='id identifier rubyid_index'>index</span>
|
|
1195
|
+
<span class='comment'>#TODO: test this throughly and find a way to delete all index table records for one source record
|
|
1196
|
+
</span> <span class='kw'>if</span> <span class='id identifier rubyid_index'>index</span><span class='period'>.</span><span class='id identifier rubyid_range_key?'>range_key?</span>
|
|
1197
|
+
<span class='id identifier rubyid_results'>results</span> <span class='op'>=</span> <span class='const'>Dynamoid</span><span class='op'>::</span><span class='const'>Adapter</span><span class='period'>.</span><span class='id identifier rubyid_query'>query</span><span class='lparen'>(</span><span class='id identifier rubyid_index'>index</span><span class='period'>.</span><span class='id identifier rubyid_table_name'>table_name</span><span class='comma'>,</span> <span class='id identifier rubyid_index_query'>index_query</span><span class='period'>.</span><span class='id identifier rubyid_merge'>merge</span><span class='lparen'>(</span><span class='id identifier rubyid_consistent_opts'>consistent_opts</span><span class='rparen'>)</span><span class='rparen'>)</span>
|
|
1198
|
+
<span class='kw'>else</span>
|
|
1199
|
+
<span class='id identifier rubyid_results'>results</span> <span class='op'>=</span> <span class='const'>Dynamoid</span><span class='op'>::</span><span class='const'>Adapter</span><span class='period'>.</span><span class='id identifier rubyid_read'>read</span><span class='lparen'>(</span><span class='id identifier rubyid_index'>index</span><span class='period'>.</span><span class='id identifier rubyid_table_name'>table_name</span><span class='comma'>,</span> <span class='id identifier rubyid_index_query'>index_query</span><span class='lbracket'>[</span><span class='symbol'>:hash_value</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='id identifier rubyid_consistent_opts'>consistent_opts</span><span class='rparen'>)</span>
|
|
1200
|
+
<span class='kw'>end</span>
|
|
1201
|
+
|
|
1202
|
+
<span class='id identifier rubyid_results'>results</span><span class='period'>.</span><span class='id identifier rubyid_collect'>collect</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_hash'>hash</span><span class='op'>|</span>
|
|
1203
|
+
<span class='id identifier rubyid_ids'>ids</span> <span class='op'><<</span> <span class='id identifier rubyid_hash'>hash</span><span class='lbracket'>[</span><span class='id identifier rubyid_source'>source</span><span class='period'>.</span><span class='id identifier rubyid_hash_key'>hash_key</span><span class='period'>.</span><span class='id identifier rubyid_to_sym'>to_sym</span><span class='rbracket'>]</span>
|
|
1204
|
+
<span class='id identifier rubyid_index_ranges'>index_ranges</span> <span class='op'><<</span> <span class='id identifier rubyid_hash'>hash</span><span class='lbracket'>[</span><span class='id identifier rubyid_source'>source</span><span class='period'>.</span><span class='id identifier rubyid_range_key'>range_key</span><span class='period'>.</span><span class='id identifier rubyid_to_sym'>to_sym</span><span class='rbracket'>]</span>
|
|
1205
|
+
<span class='kw'>end</span>
|
|
1206
|
+
|
|
1207
|
+
<span class='kw'>unless</span> <span class='id identifier rubyid_ids'>ids</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span> <span class='op'>||</span> <span class='id identifier rubyid_ids'>ids</span><span class='period'>.</span><span class='id identifier rubyid_empty?'>empty?</span>
|
|
1208
|
+
<span class='id identifier rubyid_ids'>ids</span> <span class='op'>=</span> <span class='id identifier rubyid_ids'>ids</span><span class='period'>.</span><span class='id identifier rubyid_to_a'>to_a</span>
|
|
1209
|
+
|
|
1210
|
+
<span class='kw'>if</span> <span class='ivar'>@start</span>
|
|
1211
|
+
<span class='id identifier rubyid_ids'>ids</span> <span class='op'>=</span> <span class='id identifier rubyid_ids'>ids</span><span class='period'>.</span><span class='id identifier rubyid_drop_while'>drop_while</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_id'>id</span><span class='op'>|</span> <span class='id identifier rubyid_id'>id</span> <span class='op'>!=</span> <span class='ivar'>@start</span><span class='period'>.</span><span class='id identifier rubyid_hash_key'>hash_key</span> <span class='rbrace'>}</span><span class='period'>.</span><span class='id identifier rubyid_drop'>drop</span><span class='lparen'>(</span><span class='int'>1</span><span class='rparen'>)</span>
|
|
1212
|
+
<span class='id identifier rubyid_index_ranges'>index_ranges</span> <span class='op'>=</span> <span class='id identifier rubyid_index_ranges'>index_ranges</span><span class='period'>.</span><span class='id identifier rubyid_drop_while'>drop_while</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_range'>range</span><span class='op'>|</span> <span class='id identifier rubyid_range'>range</span> <span class='op'>!=</span> <span class='ivar'>@start</span><span class='period'>.</span><span class='id identifier rubyid_hash_key'>hash_key</span> <span class='rbrace'>}</span><span class='period'>.</span><span class='id identifier rubyid_drop'>drop</span><span class='lparen'>(</span><span class='int'>1</span><span class='rparen'>)</span> <span class='kw'>unless</span> <span class='id identifier rubyid_index_ranges'>index_ranges</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
|
|
1213
|
+
<span class='kw'>end</span>
|
|
1214
|
+
|
|
1215
|
+
<span class='kw'>if</span> <span class='ivar'>@limit</span>
|
|
1216
|
+
<span class='id identifier rubyid_ids'>ids</span> <span class='op'>=</span> <span class='id identifier rubyid_ids'>ids</span><span class='period'>.</span><span class='id identifier rubyid_take'>take</span><span class='lparen'>(</span><span class='ivar'>@limit</span><span class='rparen'>)</span>
|
|
1217
|
+
<span class='id identifier rubyid_index_ranges'>index_ranges</span> <span class='op'>=</span> <span class='id identifier rubyid_index_ranges'>index_ranges</span><span class='period'>.</span><span class='id identifier rubyid_take'>take</span><span class='lparen'>(</span><span class='ivar'>@limit</span><span class='rparen'>)</span>
|
|
1218
|
+
<span class='kw'>end</span>
|
|
1219
|
+
|
|
1220
|
+
<span class='const'>Dynamoid</span><span class='op'>::</span><span class='const'>Adapter</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</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='comma'>,</span> <span class='id identifier rubyid_ids'>ids</span><span class='rparen'>)</span>
|
|
1221
|
+
|
|
1222
|
+
<span class='kw'>if</span> <span class='id identifier rubyid_index'>index</span><span class='period'>.</span><span class='id identifier rubyid_range_key?'>range_key?</span>
|
|
1223
|
+
<span class='const'>Dynamoid</span><span class='op'>::</span><span class='const'>Adapter</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='id identifier rubyid_index'>index</span><span class='period'>.</span><span class='id identifier rubyid_table_name'>table_name</span><span class='comma'>,</span> <span class='id identifier rubyid_ids'>ids</span><span class='comma'>,</span><span class='lbrace'>{</span><span class='symbol'>:range_key</span> <span class='op'>=></span> <span class='id identifier rubyid_index_ranges'>index_ranges</span><span class='rbrace'>}</span><span class='rparen'>)</span>
|
|
1224
|
+
<span class='kw'>else</span>
|
|
1225
|
+
<span class='const'>Dynamoid</span><span class='op'>::</span><span class='const'>Adapter</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='id identifier rubyid_index'>index</span><span class='period'>.</span><span class='id identifier rubyid_table_name'>table_name</span><span class='comma'>,</span> <span class='id identifier rubyid_ids'>ids</span><span class='rparen'>)</span>
|
|
1226
|
+
<span class='kw'>end</span>
|
|
1227
|
+
|
|
1228
|
+
<span class='kw'>end</span>
|
|
1229
|
+
<span class='kw'>else</span>
|
|
1230
|
+
<span class='const'>Dynamoid</span><span class='op'>::</span><span class='const'>Adapter</span><span class='period'>.</span><span class='id identifier rubyid_scan'>scan</span><span class='lparen'>(</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='comma'>,</span> <span class='id identifier rubyid_query'>query</span><span class='comma'>,</span> <span class='id identifier rubyid_scan_opts'>scan_opts</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_collect'>collect</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_hash'>hash</span><span class='op'>|</span>
|
|
1231
|
+
<span class='id identifier rubyid_ids'>ids</span> <span class='op'><<</span> <span class='id identifier rubyid_hash'>hash</span><span class='lbracket'>[</span><span class='id identifier rubyid_source'>source</span><span class='period'>.</span><span class='id identifier rubyid_hash_key'>hash_key</span><span class='period'>.</span><span class='id identifier rubyid_to_sym'>to_sym</span><span class='rbracket'>]</span>
|
|
1232
|
+
<span class='kw'>end</span>
|
|
1233
|
+
|
|
1234
|
+
<span class='const'>Dynamoid</span><span class='op'>::</span><span class='const'>Adapter</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</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='comma'>,</span> <span class='id identifier rubyid_ids'>ids</span><span class='rparen'>)</span>
|
|
1235
|
+
<span class='kw'>end</span>
|
|
1236
|
+
<span class='kw'>end</span></pre>
|
|
1237
|
+
</td>
|
|
1238
|
+
</tr>
|
|
1239
|
+
</table>
|
|
1240
|
+
</div>
|
|
1241
|
+
|
|
1242
|
+
<div class="method_details ">
|
|
1243
|
+
<h3 class="signature " id="each-instance_method">
|
|
1244
|
+
|
|
1245
|
+
- (<tt>Object</tt>) <strong>each</strong>(&block)
|
|
1246
|
+
|
|
1247
|
+
|
|
1248
|
+
|
|
1249
|
+
|
|
1250
|
+
|
|
1251
|
+
</h3><div class="docstring">
|
|
1252
|
+
<div class="discussion">
|
|
1253
|
+
<p>Allows you to use the results of a search as an enumerable over the results found.</p>
|
|
1254
|
+
|
|
1255
|
+
|
|
1256
|
+
</div>
|
|
1257
|
+
</div>
|
|
1258
|
+
<div class="tags">
|
|
1259
|
+
|
|
1260
|
+
<p class="tag_title">Since:</p>
|
|
1261
|
+
<ul class="since">
|
|
1262
|
+
|
|
1263
|
+
<li>
|
|
1264
|
+
|
|
1265
|
+
|
|
1266
|
+
|
|
1267
|
+
|
|
1268
|
+
|
|
1269
|
+
<div class='inline'><p>0.2.0</p>
|
|
1270
|
+
</div>
|
|
1271
|
+
|
|
1272
|
+
</li>
|
|
1273
|
+
|
|
1274
|
+
</ul>
|
|
1275
|
+
|
|
1276
|
+
</div><table class="source_code">
|
|
1277
|
+
<tr>
|
|
1278
|
+
<td>
|
|
1279
|
+
<pre class="lines">
|
|
1280
|
+
|
|
1281
|
+
|
|
1282
|
+
139
|
|
1283
|
+
140
|
|
1284
|
+
141</pre>
|
|
1285
|
+
</td>
|
|
1286
|
+
<td>
|
|
1287
|
+
<pre class="code"><span class="info file"># File 'lib/dynamoid/criteria/chain.rb', line 139</span>
|
|
1288
|
+
|
|
1289
|
+
<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>
|
|
1290
|
+
<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>
|
|
1291
|
+
<span class='kw'>end</span></pre>
|
|
1292
|
+
</td>
|
|
1293
|
+
</tr>
|
|
1294
|
+
</table>
|
|
1295
|
+
</div>
|
|
1296
|
+
|
|
1297
|
+
<div class="method_details ">
|
|
1298
|
+
<h3 class="signature " id="first-instance_method">
|
|
1299
|
+
|
|
1300
|
+
- (<tt>Object</tt>) <strong>first</strong>
|
|
1301
|
+
|
|
1302
|
+
|
|
1303
|
+
|
|
1304
|
+
|
|
1305
|
+
|
|
1306
|
+
</h3><div class="docstring">
|
|
1307
|
+
<div class="discussion">
|
|
1308
|
+
<p>Returns the first record matching the criteria.</p>
|
|
1309
|
+
|
|
1310
|
+
|
|
1311
|
+
</div>
|
|
1312
|
+
</div>
|
|
1313
|
+
<div class="tags">
|
|
1314
|
+
|
|
1315
|
+
<p class="tag_title">Since:</p>
|
|
1316
|
+
<ul class="since">
|
|
1317
|
+
|
|
1318
|
+
<li>
|
|
1319
|
+
|
|
1320
|
+
|
|
1321
|
+
|
|
1322
|
+
|
|
1323
|
+
|
|
1324
|
+
<div class='inline'><p>0.2.0</p>
|
|
1325
|
+
</div>
|
|
1326
|
+
|
|
1327
|
+
</li>
|
|
1328
|
+
|
|
1329
|
+
</ul>
|
|
1330
|
+
|
|
1331
|
+
</div><table class="source_code">
|
|
1332
|
+
<tr>
|
|
1333
|
+
<td>
|
|
1334
|
+
<pre class="lines">
|
|
1335
|
+
|
|
1336
|
+
|
|
1337
|
+
111
|
|
1338
|
+
112
|
|
1339
|
+
113</pre>
|
|
1340
|
+
</td>
|
|
1341
|
+
<td>
|
|
1342
|
+
<pre class="code"><span class="info file"># File 'lib/dynamoid/criteria/chain.rb', line 111</span>
|
|
1343
|
+
|
|
1344
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_first'>first</span>
|
|
1345
|
+
<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>
|
|
1346
|
+
<span class='kw'>end</span></pre>
|
|
1347
|
+
</td>
|
|
1348
|
+
</tr>
|
|
1349
|
+
</table>
|
|
1350
|
+
</div>
|
|
1351
|
+
|
|
1352
|
+
<div class="method_details ">
|
|
1353
|
+
<h3 class="signature " id="scan_index_forward-instance_method">
|
|
1354
|
+
|
|
1355
|
+
- (<tt>Object</tt>) <strong>scan_index_forward</strong>(scan_index_forward)
|
|
1356
|
+
|
|
1357
|
+
|
|
1358
|
+
|
|
1359
|
+
|
|
1360
|
+
|
|
1361
|
+
</h3><table class="source_code">
|
|
1362
|
+
<tr>
|
|
1363
|
+
<td>
|
|
1364
|
+
<pre class="lines">
|
|
1365
|
+
|
|
1366
|
+
|
|
1367
|
+
131
|
|
1368
|
+
132
|
|
1369
|
+
133
|
|
1370
|
+
134</pre>
|
|
1371
|
+
</td>
|
|
1372
|
+
<td>
|
|
1373
|
+
<pre class="code"><span class="info file"># File 'lib/dynamoid/criteria/chain.rb', line 131</span>
|
|
1374
|
+
|
|
1375
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_scan_index_forward'>scan_index_forward</span><span class='lparen'>(</span><span class='id identifier rubyid_scan_index_forward'>scan_index_forward</span><span class='rparen'>)</span>
|
|
1376
|
+
<span class='ivar'>@scan_index_forward</span> <span class='op'>=</span> <span class='id identifier rubyid_scan_index_forward'>scan_index_forward</span>
|
|
1377
|
+
<span class='kw'>self</span>
|
|
1378
|
+
<span class='kw'>end</span></pre>
|
|
1379
|
+
</td>
|
|
1380
|
+
</tr>
|
|
1381
|
+
</table>
|
|
1382
|
+
</div>
|
|
1383
|
+
|
|
1384
|
+
<div class="method_details ">
|
|
1385
|
+
<h3 class="signature " id="where-instance_method">
|
|
1386
|
+
|
|
1387
|
+
- (<tt>Object</tt>) <strong>where</strong>(args)
|
|
1388
|
+
|
|
1389
|
+
|
|
1390
|
+
|
|
1391
|
+
|
|
1392
|
+
|
|
1393
|
+
</h3><div class="docstring">
|
|
1394
|
+
<div class="discussion">
|
|
1395
|
+
<p>The workhorse method of the criteria chain. Each key in the passed in hash will become another criteria that the
|
|
1396
|
+
ultimate query must match. A key can either be a symbol or a string, and should be an attribute name or
|
|
1397
|
+
an attribute name with a range operator.</p>
|
|
1398
|
+
|
|
1399
|
+
|
|
1400
|
+
</div>
|
|
1401
|
+
</div>
|
|
1402
|
+
<div class="tags">
|
|
1403
|
+
|
|
1404
|
+
<div class="examples">
|
|
1405
|
+
<p class="tag_title">Examples:</p>
|
|
1406
|
+
|
|
1407
|
+
|
|
1408
|
+
<p class="example_title"><div class='inline'><p>A simple criteria</p>
|
|
1409
|
+
</div></p>
|
|
1410
|
+
|
|
1411
|
+
<pre class="example code"><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></code></pre>
|
|
1412
|
+
|
|
1413
|
+
|
|
1414
|
+
<p class="example_title"><div class='inline'><p>A more complicated criteria</p>
|
|
1415
|
+
</div></p>
|
|
1416
|
+
|
|
1417
|
+
<pre class="example code"><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></code></pre>
|
|
1418
|
+
|
|
1419
|
+
</div>
|
|
1420
|
+
|
|
1421
|
+
<p class="tag_title">Since:</p>
|
|
1422
|
+
<ul class="since">
|
|
1423
|
+
|
|
1424
|
+
<li>
|
|
1425
|
+
|
|
1426
|
+
|
|
1427
|
+
|
|
1428
|
+
|
|
1429
|
+
|
|
1430
|
+
<div class='inline'><p>0.2.0</p>
|
|
1431
|
+
</div>
|
|
1432
|
+
|
|
1433
|
+
</li>
|
|
1434
|
+
|
|
1435
|
+
</ul>
|
|
1436
|
+
|
|
1437
|
+
</div><table class="source_code">
|
|
1438
|
+
<tr>
|
|
1439
|
+
<td>
|
|
1440
|
+
<pre class="lines">
|
|
1441
|
+
|
|
1442
|
+
|
|
1443
|
+
33
|
|
1444
|
+
34
|
|
1445
|
+
35
|
|
1446
|
+
36</pre>
|
|
1447
|
+
</td>
|
|
1448
|
+
<td>
|
|
1449
|
+
<pre class="code"><span class="info file"># File 'lib/dynamoid/criteria/chain.rb', line 33</span>
|
|
1450
|
+
|
|
1451
|
+
<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>
|
|
1452
|
+
<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='period'>.</span><span class='id identifier rubyid_to_sym'>to_sym</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_v'>v</span><span class='rbrace'>}</span>
|
|
1453
|
+
<span class='kw'>self</span>
|
|
1454
|
+
<span class='kw'>end</span></pre>
|
|
1455
|
+
</td>
|
|
1456
|
+
</tr>
|
|
1457
|
+
</table>
|
|
1458
|
+
</div>
|
|
1459
|
+
|
|
1460
|
+
</div>
|
|
1461
|
+
|
|
1462
|
+
</div>
|
|
1463
|
+
|
|
1464
|
+
<div id="footer">
|
|
1465
|
+
Generated on Thu Jun 27 21:59:14 2013 by
|
|
1466
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
1467
|
+
0.8.6.1 (ruby-1.9.3).
|
|
1468
|
+
</div>
|
|
1469
|
+
|
|
1470
|
+
</body>
|
|
1471
|
+
</html>
|