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,438 @@
|
|
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
|
2
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
3
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
|
4
|
+
<head>
|
|
5
|
+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
|
6
|
+
<title>
|
|
7
|
+
Module: Dynamoid::Fields::ClassMethods
|
|
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="../Fields.html" title="Dynamoid::Fields (module)">Fields</a></span></span>
|
|
36
|
+
»
|
|
37
|
+
<span class="title">ClassMethods</span>
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
|
41
|
+
</div>
|
|
42
|
+
|
|
43
|
+
<div id="search">
|
|
44
|
+
|
|
45
|
+
<a class="full_list_link" id="class_list_link"
|
|
46
|
+
href="../../class_list.html">
|
|
47
|
+
Class List
|
|
48
|
+
</a>
|
|
49
|
+
|
|
50
|
+
<a class="full_list_link" id="method_list_link"
|
|
51
|
+
href="../../method_list.html">
|
|
52
|
+
Method List
|
|
53
|
+
</a>
|
|
54
|
+
|
|
55
|
+
<a class="full_list_link" id="file_list_link"
|
|
56
|
+
href="../../file_list.html">
|
|
57
|
+
File List
|
|
58
|
+
</a>
|
|
59
|
+
|
|
60
|
+
</div>
|
|
61
|
+
<div class="clear"></div>
|
|
62
|
+
</div>
|
|
63
|
+
|
|
64
|
+
<iframe id="search_frame"></iframe>
|
|
65
|
+
|
|
66
|
+
<div id="content"><h1>Module: Dynamoid::Fields::ClassMethods
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
</h1>
|
|
71
|
+
|
|
72
|
+
<dl class="box">
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
<dt class="r1 last">Defined in:</dt>
|
|
82
|
+
<dd class="r1 last">lib/dynamoid/fields.rb</dd>
|
|
83
|
+
|
|
84
|
+
</dl>
|
|
85
|
+
<div class="clear"></div>
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
<h2>
|
|
96
|
+
Instance Method Summary
|
|
97
|
+
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
|
|
98
|
+
</h2>
|
|
99
|
+
|
|
100
|
+
<ul class="summary">
|
|
101
|
+
|
|
102
|
+
<li class="public ">
|
|
103
|
+
<span class="summary_signature">
|
|
104
|
+
|
|
105
|
+
<a href="#field-instance_method" title="#field (instance method)">- (Object) <strong>field</strong>(name, type = :string, options = {}) </a>
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
</span>
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
<span class="summary_desc"><div class='inline'><p>Specify a field for a document.</p>
|
|
120
|
+
</div></span>
|
|
121
|
+
|
|
122
|
+
</li>
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
<li class="public ">
|
|
126
|
+
<span class="summary_signature">
|
|
127
|
+
|
|
128
|
+
<a href="#range-instance_method" title="#range (instance method)">- (Object) <strong>range</strong>(name, type = :string) </a>
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
</span>
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
|
143
|
+
|
|
144
|
+
</li>
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+
<li class="public ">
|
|
148
|
+
<span class="summary_signature">
|
|
149
|
+
|
|
150
|
+
<a href="#remove_field-instance_method" title="#remove_field (instance method)">- (Object) <strong>remove_field</strong>(field) </a>
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
</span>
|
|
155
|
+
|
|
156
|
+
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
|
|
160
|
+
|
|
161
|
+
|
|
162
|
+
|
|
163
|
+
|
|
164
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
|
165
|
+
|
|
166
|
+
</li>
|
|
167
|
+
|
|
168
|
+
|
|
169
|
+
<li class="public ">
|
|
170
|
+
<span class="summary_signature">
|
|
171
|
+
|
|
172
|
+
<a href="#table-instance_method" title="#table (instance method)">- (Object) <strong>table</strong>(options) </a>
|
|
173
|
+
|
|
174
|
+
|
|
175
|
+
|
|
176
|
+
</span>
|
|
177
|
+
|
|
178
|
+
|
|
179
|
+
|
|
180
|
+
|
|
181
|
+
|
|
182
|
+
|
|
183
|
+
|
|
184
|
+
|
|
185
|
+
|
|
186
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
|
187
|
+
|
|
188
|
+
</li>
|
|
189
|
+
|
|
190
|
+
|
|
191
|
+
</ul>
|
|
192
|
+
|
|
193
|
+
|
|
194
|
+
|
|
195
|
+
|
|
196
|
+
<div id="instance_method_details" class="method_details_list">
|
|
197
|
+
<h2>Instance Method Details</h2>
|
|
198
|
+
|
|
199
|
+
|
|
200
|
+
<div class="method_details first">
|
|
201
|
+
<h3 class="signature first" id="field-instance_method">
|
|
202
|
+
|
|
203
|
+
- (<tt>Object</tt>) <strong>field</strong>(name, type = :string, options = {})
|
|
204
|
+
|
|
205
|
+
|
|
206
|
+
|
|
207
|
+
|
|
208
|
+
|
|
209
|
+
</h3><div class="docstring">
|
|
210
|
+
<div class="discussion">
|
|
211
|
+
<p>Specify a field for a document. Its type determines how it is coerced when read in and out of the datastore:
|
|
212
|
+
default is string, but you can also specify :integer, :float, :set, :array, :datetime, and :serialized.</p>
|
|
213
|
+
|
|
214
|
+
|
|
215
|
+
</div>
|
|
216
|
+
</div>
|
|
217
|
+
<div class="tags">
|
|
218
|
+
<p class="tag_title">Parameters:</p>
|
|
219
|
+
<ul class="param">
|
|
220
|
+
|
|
221
|
+
<li>
|
|
222
|
+
|
|
223
|
+
<span class='name'>name</span>
|
|
224
|
+
|
|
225
|
+
|
|
226
|
+
<span class='type'>(<tt>Symbol</tt>)</span>
|
|
227
|
+
|
|
228
|
+
|
|
229
|
+
|
|
230
|
+
—
|
|
231
|
+
<div class='inline'><p>the name of the field</p>
|
|
232
|
+
</div>
|
|
233
|
+
|
|
234
|
+
</li>
|
|
235
|
+
|
|
236
|
+
<li>
|
|
237
|
+
|
|
238
|
+
<span class='name'>type</span>
|
|
239
|
+
|
|
240
|
+
|
|
241
|
+
<span class='type'>(<tt>Symbol</tt>)</span>
|
|
242
|
+
|
|
243
|
+
|
|
244
|
+
<em class="default">(defaults to: <tt>:string</tt>)</em>
|
|
245
|
+
|
|
246
|
+
|
|
247
|
+
—
|
|
248
|
+
<div class='inline'><p>the type of the field (one of :integer, :float, :set, :array, :datetime, or :serialized)</p>
|
|
249
|
+
</div>
|
|
250
|
+
|
|
251
|
+
</li>
|
|
252
|
+
|
|
253
|
+
<li>
|
|
254
|
+
|
|
255
|
+
<span class='name'>options</span>
|
|
256
|
+
|
|
257
|
+
|
|
258
|
+
<span class='type'>(<tt>Hash</tt>)</span>
|
|
259
|
+
|
|
260
|
+
|
|
261
|
+
<em class="default">(defaults to: <tt>{}</tt>)</em>
|
|
262
|
+
|
|
263
|
+
|
|
264
|
+
—
|
|
265
|
+
<div class='inline'><p>any additional options for the field</p>
|
|
266
|
+
</div>
|
|
267
|
+
|
|
268
|
+
</li>
|
|
269
|
+
|
|
270
|
+
</ul>
|
|
271
|
+
|
|
272
|
+
<p class="tag_title">Since:</p>
|
|
273
|
+
<ul class="since">
|
|
274
|
+
|
|
275
|
+
<li>
|
|
276
|
+
|
|
277
|
+
|
|
278
|
+
|
|
279
|
+
|
|
280
|
+
|
|
281
|
+
<div class='inline'><p>0.2.0</p>
|
|
282
|
+
</div>
|
|
283
|
+
|
|
284
|
+
</li>
|
|
285
|
+
|
|
286
|
+
</ul>
|
|
287
|
+
|
|
288
|
+
</div><table class="source_code">
|
|
289
|
+
<tr>
|
|
290
|
+
<td>
|
|
291
|
+
<pre class="lines">
|
|
292
|
+
|
|
293
|
+
|
|
294
|
+
31
|
|
295
|
+
32
|
|
296
|
+
33
|
|
297
|
+
34
|
|
298
|
+
35
|
|
299
|
+
36
|
|
300
|
+
37
|
|
301
|
+
38</pre>
|
|
302
|
+
</td>
|
|
303
|
+
<td>
|
|
304
|
+
<pre class="code"><span class="info file"># File 'lib/dynamoid/fields.rb', line 31</span>
|
|
305
|
+
|
|
306
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_field'>field</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='comma'>,</span> <span class='id identifier rubyid_type'>type</span> <span class='op'>=</span> <span class='symbol'>:string</span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
|
|
307
|
+
<span class='id identifier rubyid_named'>named</span> <span class='op'>=</span> <span class='id identifier rubyid_name'>name</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span>
|
|
308
|
+
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_attributes'>attributes</span> <span class='op'>=</span> <span class='id identifier rubyid_attributes'>attributes</span><span class='period'>.</span><span class='id identifier rubyid_merge'>merge</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span> <span class='op'>=></span> <span class='lbrace'>{</span><span class='symbol'>:type</span> <span class='op'>=></span> <span class='id identifier rubyid_type'>type</span><span class='rbrace'>}</span><span class='period'>.</span><span class='id identifier rubyid_merge'>merge</span><span class='lparen'>(</span><span class='id identifier rubyid_options'>options</span><span class='rparen'>)</span><span class='rparen'>)</span>
|
|
309
|
+
|
|
310
|
+
<span class='id identifier rubyid_define_method'>define_method</span><span class='lparen'>(</span><span class='id identifier rubyid_named'>named</span><span class='rparen'>)</span> <span class='lbrace'>{</span> <span class='id identifier rubyid_read_attribute'>read_attribute</span><span class='lparen'>(</span><span class='id identifier rubyid_named'>named</span><span class='rparen'>)</span> <span class='rbrace'>}</span>
|
|
311
|
+
<span class='id identifier rubyid_define_method'>define_method</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_named'>named</span><span class='rbrace'>}</span><span class='tstring_content'>?</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span> <span class='lbrace'>{</span> <span class='op'>!</span><span class='id identifier rubyid_read_attribute'>read_attribute</span><span class='lparen'>(</span><span class='id identifier rubyid_named'>named</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span> <span class='rbrace'>}</span>
|
|
312
|
+
<span class='id identifier rubyid_define_method'>define_method</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_named'>named</span><span class='rbrace'>}</span><span class='tstring_content'>=</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span> <span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_value'>value</span><span class='op'>|</span> <span class='id identifier rubyid_write_attribute'>write_attribute</span><span class='lparen'>(</span><span class='id identifier rubyid_named'>named</span><span class='comma'>,</span> <span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span> <span class='rbrace'>}</span>
|
|
313
|
+
<span class='kw'>end</span></pre>
|
|
314
|
+
</td>
|
|
315
|
+
</tr>
|
|
316
|
+
</table>
|
|
317
|
+
</div>
|
|
318
|
+
|
|
319
|
+
<div class="method_details ">
|
|
320
|
+
<h3 class="signature " id="range-instance_method">
|
|
321
|
+
|
|
322
|
+
- (<tt>Object</tt>) <strong>range</strong>(name, type = :string)
|
|
323
|
+
|
|
324
|
+
|
|
325
|
+
|
|
326
|
+
|
|
327
|
+
|
|
328
|
+
</h3><table class="source_code">
|
|
329
|
+
<tr>
|
|
330
|
+
<td>
|
|
331
|
+
<pre class="lines">
|
|
332
|
+
|
|
333
|
+
|
|
334
|
+
40
|
|
335
|
+
41
|
|
336
|
+
42
|
|
337
|
+
43</pre>
|
|
338
|
+
</td>
|
|
339
|
+
<td>
|
|
340
|
+
<pre class="code"><span class="info file"># File 'lib/dynamoid/fields.rb', line 40</span>
|
|
341
|
+
|
|
342
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_range'>range</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='comma'>,</span> <span class='id identifier rubyid_type'>type</span> <span class='op'>=</span> <span class='symbol'>:string</span><span class='rparen'>)</span>
|
|
343
|
+
<span class='id identifier rubyid_field'>field</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='comma'>,</span> <span class='id identifier rubyid_type'>type</span><span class='rparen'>)</span>
|
|
344
|
+
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_range_key'>range_key</span> <span class='op'>=</span> <span class='id identifier rubyid_name'>name</span>
|
|
345
|
+
<span class='kw'>end</span></pre>
|
|
346
|
+
</td>
|
|
347
|
+
</tr>
|
|
348
|
+
</table>
|
|
349
|
+
</div>
|
|
350
|
+
|
|
351
|
+
<div class="method_details ">
|
|
352
|
+
<h3 class="signature " id="remove_field-instance_method">
|
|
353
|
+
|
|
354
|
+
- (<tt>Object</tt>) <strong>remove_field</strong>(field)
|
|
355
|
+
|
|
356
|
+
|
|
357
|
+
|
|
358
|
+
|
|
359
|
+
|
|
360
|
+
</h3><table class="source_code">
|
|
361
|
+
<tr>
|
|
362
|
+
<td>
|
|
363
|
+
<pre class="lines">
|
|
364
|
+
|
|
365
|
+
|
|
366
|
+
53
|
|
367
|
+
54
|
|
368
|
+
55
|
|
369
|
+
56
|
|
370
|
+
57
|
|
371
|
+
58
|
|
372
|
+
59</pre>
|
|
373
|
+
</td>
|
|
374
|
+
<td>
|
|
375
|
+
<pre class="code"><span class="info file"># File 'lib/dynamoid/fields.rb', line 53</span>
|
|
376
|
+
|
|
377
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_remove_field'>remove_field</span><span class='lparen'>(</span><span class='id identifier rubyid_field'>field</span><span class='rparen'>)</span>
|
|
378
|
+
<span class='id identifier rubyid_field'>field</span> <span class='op'>=</span> <span class='id identifier rubyid_field'>field</span><span class='period'>.</span><span class='id identifier rubyid_to_sym'>to_sym</span>
|
|
379
|
+
<span class='id identifier rubyid_attributes'>attributes</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='id identifier rubyid_field'>field</span><span class='rparen'>)</span> <span class='kw'>or</span> <span class='id identifier rubyid_raise'>raise</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>No such field</span><span class='tstring_end'>"</span></span>
|
|
380
|
+
<span class='id identifier rubyid_remove_method'>remove_method</span> <span class='id identifier rubyid_field'>field</span>
|
|
381
|
+
<span class='id identifier rubyid_remove_method'>remove_method</span> <span class='symbol'>:#{</span><span class='id identifier rubyid_field'>field</span><span class='rbrace'>}</span><span class='tstring_content'>=</span><span class='tstring_end'>"</span></span>
|
|
382
|
+
<span class='id identifier rubyid_remove_method'>remove_method</span> <span class='symbol'>:#{</span><span class='id identifier rubyid_field'>field</span><span class='rbrace'>}</span><span class='tstring_content'>?</span><span class='tstring_end'>"</span></span>
|
|
383
|
+
<span class='kw'>end</span></pre>
|
|
384
|
+
</td>
|
|
385
|
+
</tr>
|
|
386
|
+
</table>
|
|
387
|
+
</div>
|
|
388
|
+
|
|
389
|
+
<div class="method_details ">
|
|
390
|
+
<h3 class="signature " id="table-instance_method">
|
|
391
|
+
|
|
392
|
+
- (<tt>Object</tt>) <strong>table</strong>(options)
|
|
393
|
+
|
|
394
|
+
|
|
395
|
+
|
|
396
|
+
|
|
397
|
+
|
|
398
|
+
</h3><table class="source_code">
|
|
399
|
+
<tr>
|
|
400
|
+
<td>
|
|
401
|
+
<pre class="lines">
|
|
402
|
+
|
|
403
|
+
|
|
404
|
+
45
|
|
405
|
+
46
|
|
406
|
+
47
|
|
407
|
+
48
|
|
408
|
+
49
|
|
409
|
+
50
|
|
410
|
+
51</pre>
|
|
411
|
+
</td>
|
|
412
|
+
<td>
|
|
413
|
+
<pre class="code"><span class="info file"># File 'lib/dynamoid/fields.rb', line 45</span>
|
|
414
|
+
|
|
415
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_table'>table</span><span class='lparen'>(</span><span class='id identifier rubyid_options'>options</span><span class='rparen'>)</span>
|
|
416
|
+
<span class='comment'>#a default 'id' column is created when Dynamoid::Document is included
|
|
417
|
+
</span> <span class='kw'>unless</span><span class='lparen'>(</span><span class='id identifier rubyid_attributes'>attributes</span><span class='period'>.</span><span class='id identifier rubyid_has_key?'>has_key?</span> <span class='id identifier rubyid_hash_key'>hash_key</span><span class='rparen'>)</span>
|
|
418
|
+
<span class='id identifier rubyid_remove_field'>remove_field</span> <span class='symbol'>:id</span>
|
|
419
|
+
<span class='id identifier rubyid_field'>field</span><span class='lparen'>(</span><span class='id identifier rubyid_hash_key'>hash_key</span><span class='rparen'>)</span>
|
|
420
|
+
<span class='kw'>end</span>
|
|
421
|
+
<span class='kw'>end</span></pre>
|
|
422
|
+
</td>
|
|
423
|
+
</tr>
|
|
424
|
+
</table>
|
|
425
|
+
</div>
|
|
426
|
+
|
|
427
|
+
</div>
|
|
428
|
+
|
|
429
|
+
</div>
|
|
430
|
+
|
|
431
|
+
<div id="footer">
|
|
432
|
+
Generated on Thu Jun 27 21:59:09 2013 by
|
|
433
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
434
|
+
0.8.6.1 (ruby-1.9.3).
|
|
435
|
+
</div>
|
|
436
|
+
|
|
437
|
+
</body>
|
|
438
|
+
</html>
|
|
@@ -0,0 +1,135 @@
|
|
|
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::Finders
|
|
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 (F)</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">Finders</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::Finders
|
|
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/finders.rb</dd>
|
|
91
|
+
|
|
92
|
+
</dl>
|
|
93
|
+
<div class="clear"></div>
|
|
94
|
+
|
|
95
|
+
<h2>Overview</h2><div class="docstring">
|
|
96
|
+
<div class="discussion">
|
|
97
|
+
<p>This module defines the finder methods that hang off the document at the
|
|
98
|
+
class level, like find, find_by_id, and the method_missing style finders.</p>
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
</div>
|
|
102
|
+
</div>
|
|
103
|
+
<div class="tags">
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
</div><h2>Defined Under Namespace</h2>
|
|
107
|
+
<p class="children">
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
<strong class="modules">Modules:</strong> <span class='object_link'><a href="Finders/ClassMethods.html" title="Dynamoid::Finders::ClassMethods (module)">ClassMethods</a></span>
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
</p>
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
</div>
|
|
127
|
+
|
|
128
|
+
<div id="footer">
|
|
129
|
+
Generated on Thu Jun 27 21:59:10 2013 by
|
|
130
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
131
|
+
0.8.6.1 (ruby-1.9.3).
|
|
132
|
+
</div>
|
|
133
|
+
|
|
134
|
+
</body>
|
|
135
|
+
</html>
|