dynamoid 0.6.1 → 0.7.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.travis.yml +4 -0
- data/Gemfile +3 -2
- data/Gemfile.lock +40 -45
- data/README.markdown +55 -25
- data/Rakefile +31 -0
- data/VERSION +1 -1
- data/doc/Dynamoid.html +58 -42
- data/doc/Dynamoid/Adapter.html +666 -179
- data/doc/Dynamoid/Adapter/AwsSdk.html +752 -236
- data/doc/Dynamoid/Associations.html +28 -21
- data/doc/Dynamoid/Associations/Association.html +102 -49
- data/doc/Dynamoid/Associations/BelongsTo.html +28 -25
- data/doc/Dynamoid/Associations/ClassMethods.html +95 -52
- data/doc/Dynamoid/Associations/HasAndBelongsToMany.html +28 -25
- data/doc/Dynamoid/Associations/HasMany.html +28 -25
- data/doc/Dynamoid/Associations/HasOne.html +28 -25
- data/doc/Dynamoid/Associations/ManyAssociation.html +138 -94
- data/doc/Dynamoid/Associations/SingleAssociation.html +67 -38
- data/doc/Dynamoid/Components.html +60 -22
- data/doc/Dynamoid/Config.html +61 -44
- data/doc/Dynamoid/Config/Options.html +90 -61
- data/doc/Dynamoid/Criteria.html +28 -21
- data/doc/Dynamoid/Criteria/Chain.html +508 -100
- data/doc/Dynamoid/Criteria/ClassMethods.html +26 -19
- data/doc/Dynamoid/Dirty.html +424 -0
- data/doc/Dynamoid/Dirty/ClassMethods.html +174 -0
- data/doc/Dynamoid/Document.html +451 -84
- data/doc/Dynamoid/Document/ClassMethods.html +281 -102
- data/doc/Dynamoid/Errors.html +29 -22
- data/doc/Dynamoid/Errors/ConditionalCheckFailedException.html +141 -0
- data/doc/Dynamoid/Errors/DocumentNotValid.html +36 -25
- data/doc/Dynamoid/Errors/Error.html +27 -20
- data/doc/Dynamoid/Errors/InvalidField.html +27 -19
- data/doc/Dynamoid/Errors/InvalidQuery.html +131 -0
- data/doc/Dynamoid/Errors/MissingRangeKey.html +27 -19
- data/doc/Dynamoid/Fields.html +94 -77
- data/doc/Dynamoid/Fields/ClassMethods.html +166 -37
- data/doc/Dynamoid/Finders.html +28 -21
- data/doc/Dynamoid/Finders/ClassMethods.html +505 -78
- data/doc/Dynamoid/IdentityMap.html +492 -0
- data/doc/Dynamoid/IdentityMap/ClassMethods.html +534 -0
- data/doc/Dynamoid/Indexes.html +41 -28
- data/doc/Dynamoid/Indexes/ClassMethods.html +45 -29
- data/doc/Dynamoid/Indexes/Index.html +100 -62
- data/doc/Dynamoid/Middleware.html +115 -0
- data/doc/Dynamoid/Middleware/IdentityMap.html +264 -0
- data/doc/Dynamoid/Persistence.html +326 -85
- data/doc/Dynamoid/Persistence/ClassMethods.html +275 -109
- data/doc/Dynamoid/Validations.html +47 -31
- data/doc/_index.html +116 -71
- data/doc/class_list.html +13 -7
- data/doc/css/full_list.css +4 -2
- data/doc/css/style.css +60 -44
- data/doc/file.LICENSE.html +26 -19
- data/doc/file.README.html +152 -48
- data/doc/file_list.html +14 -8
- data/doc/frames.html +20 -5
- data/doc/index.html +152 -48
- data/doc/js/app.js +52 -43
- data/doc/js/full_list.js +14 -9
- data/doc/js/jquery.js +4 -16
- data/doc/method_list.html +446 -540
- data/doc/top-level-namespace.html +27 -20
- data/{Dynamoid.gemspec → dynamoid.gemspec} +21 -8
- data/lib/dynamoid/adapter.rb +11 -10
- data/lib/dynamoid/adapter/aws_sdk.rb +40 -19
- data/lib/dynamoid/components.rb +2 -1
- data/lib/dynamoid/criteria/chain.rb +29 -11
- data/lib/dynamoid/dirty.rb +6 -0
- data/lib/dynamoid/document.rb +34 -19
- data/lib/dynamoid/fields.rb +36 -30
- data/lib/dynamoid/finders.rb +7 -5
- data/lib/dynamoid/persistence.rb +37 -10
- data/spec/app/models/address.rb +2 -0
- data/spec/app/models/camel_case.rb +10 -0
- data/spec/app/models/car.rb +6 -0
- data/spec/app/models/nuclear_submarine.rb +5 -0
- data/spec/app/models/subscription.rb +2 -2
- data/spec/app/models/vehicle.rb +7 -0
- data/spec/dynamoid/adapter/aws_sdk_spec.rb +20 -11
- data/spec/dynamoid/adapter_spec.rb +67 -82
- data/spec/dynamoid/associations/association_spec.rb +30 -30
- data/spec/dynamoid/criteria/chain_spec.rb +56 -9
- data/spec/dynamoid/criteria_spec.rb +3 -0
- data/spec/dynamoid/dirty_spec.rb +8 -0
- data/spec/dynamoid/document_spec.rb +109 -47
- data/spec/dynamoid/fields_spec.rb +32 -3
- data/spec/dynamoid/finders_spec.rb +12 -0
- data/spec/dynamoid/persistence_spec.rb +73 -8
- data/spec/spec_helper.rb +1 -0
- data/spec/support/with_partitioning.rb +15 -0
- metadata +22 -9
data/doc/Dynamoid/Config.html
CHANGED
@@ -6,19 +6,21 @@
|
|
6
6
|
<title>
|
7
7
|
Module: Dynamoid::Config
|
8
8
|
|
9
|
-
— Documentation by YARD 0.
|
9
|
+
— Documentation by YARD 0.8.6.1
|
10
10
|
|
11
11
|
</title>
|
12
12
|
|
13
|
-
<link rel="stylesheet" href="../css/style.css" type="text/css"
|
13
|
+
<link rel="stylesheet" href="../css/style.css" type="text/css" charset="utf-8" />
|
14
14
|
|
15
|
-
<link rel="stylesheet" href="../css/common.css" type="text/css"
|
15
|
+
<link rel="stylesheet" href="../css/common.css" type="text/css" charset="utf-8" />
|
16
16
|
|
17
17
|
<script type="text/javascript" charset="utf-8">
|
18
|
-
|
19
|
-
|
18
|
+
hasFrames = window.top.frames.main ? true : false;
|
19
|
+
relpath = '../';
|
20
|
+
framesUrl = "../frames.html#!" + escape(window.location.href);
|
20
21
|
</script>
|
21
22
|
|
23
|
+
|
22
24
|
<script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
|
23
25
|
|
24
26
|
<script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
|
@@ -26,36 +28,41 @@
|
|
26
28
|
|
27
29
|
</head>
|
28
30
|
<body>
|
29
|
-
<script type="text/javascript" charset="utf-8">
|
30
|
-
if (window.top.frames.main) document.body.className = 'frames';
|
31
|
-
</script>
|
32
|
-
|
33
31
|
<div id="header">
|
34
32
|
<div id="menu">
|
35
33
|
|
36
|
-
<a href="../_index.html">Index (C)</a> »
|
34
|
+
<a href="../_index.html">Index (C)</a> »
|
37
35
|
<span class='title'><span class='object_link'><a href="../Dynamoid.html" title="Dynamoid (module)">Dynamoid</a></span></span>
|
38
36
|
»
|
39
37
|
<span class="title">Config</span>
|
40
38
|
|
41
|
-
|
39
|
+
|
42
40
|
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
43
41
|
</div>
|
44
42
|
|
45
43
|
<div id="search">
|
46
44
|
|
47
|
-
<a
|
45
|
+
<a class="full_list_link" id="class_list_link"
|
46
|
+
href="../class_list.html">
|
47
|
+
Class List
|
48
|
+
</a>
|
48
49
|
|
49
|
-
<a
|
50
|
+
<a class="full_list_link" id="method_list_link"
|
51
|
+
href="../method_list.html">
|
52
|
+
Method List
|
53
|
+
</a>
|
50
54
|
|
51
|
-
<a
|
55
|
+
<a class="full_list_link" id="file_list_link"
|
56
|
+
href="../file_list.html">
|
57
|
+
File List
|
58
|
+
</a>
|
52
59
|
|
53
60
|
</div>
|
54
61
|
<div class="clear"></div>
|
55
62
|
</div>
|
56
|
-
|
63
|
+
|
57
64
|
<iframe id="search_frame"></iframe>
|
58
|
-
|
65
|
+
|
59
66
|
<div id="content"><h1>Module: Dynamoid::Config
|
60
67
|
|
61
68
|
|
@@ -103,11 +110,11 @@
|
|
103
110
|
|
104
111
|
</div><h2>Defined Under Namespace</h2>
|
105
112
|
<p class="children">
|
106
|
-
|
113
|
+
|
107
114
|
|
108
115
|
<strong class="modules">Modules:</strong> <span class='object_link'><a href="Config/Options.html" title="Dynamoid::Config::Options (module)">Options</a></span>
|
109
116
|
|
110
|
-
|
117
|
+
|
111
118
|
|
112
119
|
|
113
120
|
</p>
|
@@ -140,6 +147,7 @@
|
|
140
147
|
|
141
148
|
|
142
149
|
|
150
|
+
|
143
151
|
|
144
152
|
|
145
153
|
<span class="summary_desc"><div class='inline'><p>The default logger for Dynamoid: either the Rails logger or just stdout.</p>
|
@@ -162,6 +170,7 @@
|
|
162
170
|
|
163
171
|
|
164
172
|
|
173
|
+
|
165
174
|
|
166
175
|
|
167
176
|
<span class="summary_desc"><div class='inline'><p>Returns the assigned logger instance.</p>
|
@@ -184,6 +193,7 @@
|
|
184
193
|
|
185
194
|
|
186
195
|
|
196
|
+
|
187
197
|
|
188
198
|
|
189
199
|
<span class="summary_desc"><div class='inline'><p>If you want to, set the logger manually to any output you'd like.</p>
|
@@ -203,6 +213,7 @@
|
|
203
213
|
|
204
214
|
|
205
215
|
|
216
|
+
|
206
217
|
<h3 class="inherited">Methods included from <span class='object_link'><a href="Config/Options.html" title="Dynamoid::Config::Options (module)">Options</a></span></h3>
|
207
218
|
<p class="inherited"><span class='object_link'><a href="Config/Options.html#defaults-instance_method" title="Dynamoid::Config::Options#defaults (method)">defaults</a></span>, <span class='object_link'><a href="Config/Options.html#option-instance_method" title="Dynamoid::Config::Options#option (method)">option</a></span>, <span class='object_link'><a href="Config/Options.html#reset-instance_method" title="Dynamoid::Config::Options#reset (method)">reset</a></span>, <span class='object_link'><a href="Config/Options.html#settings-instance_method" title="Dynamoid::Config::Options#settings (method)">settings</a></span></p>
|
208
219
|
|
@@ -210,16 +221,18 @@
|
|
210
221
|
|
211
222
|
<div id="instance_method_details" class="method_details_list">
|
212
223
|
<h2>Instance Method Details</h2>
|
213
|
-
|
224
|
+
|
214
225
|
|
215
226
|
<div class="method_details first">
|
216
|
-
<
|
227
|
+
<h3 class="signature first" id="default_logger-instance_method">
|
217
228
|
|
218
229
|
- (<tt>Object</tt>) <strong>default_logger</strong>
|
219
230
|
|
220
231
|
|
221
232
|
|
222
|
-
|
233
|
+
|
234
|
+
|
235
|
+
</h3><div class="docstring">
|
223
236
|
<div class="discussion">
|
224
237
|
<p>The default logger for Dynamoid: either the Rails logger or just stdout.</p>
|
225
238
|
|
@@ -228,7 +241,7 @@
|
|
228
241
|
</div>
|
229
242
|
<div class="tags">
|
230
243
|
|
231
|
-
<
|
244
|
+
<p class="tag_title">Since:</p>
|
232
245
|
<ul class="since">
|
233
246
|
|
234
247
|
<li>
|
@@ -250,12 +263,12 @@
|
|
250
263
|
<pre class="lines">
|
251
264
|
|
252
265
|
|
253
|
-
|
254
|
-
|
255
|
-
|
266
|
+
33
|
267
|
+
34
|
268
|
+
35</pre>
|
256
269
|
</td>
|
257
270
|
<td>
|
258
|
-
<pre class="code"><span class="info file"># File 'lib/dynamoid/config.rb', line
|
271
|
+
<pre class="code"><span class="info file"># File 'lib/dynamoid/config.rb', line 33</span>
|
259
272
|
|
260
273
|
<span class='kw'>def</span> <span class='id identifier rubyid_default_logger'>default_logger</span>
|
261
274
|
<span class='kw'>defined?</span><span class='lparen'>(</span><span class='const'>Rails</span><span class='rparen'>)</span> <span class='op'>&&</span> <span class='const'>Rails</span><span class='period'>.</span><span class='id identifier rubyid_respond_to?'>respond_to?</span><span class='lparen'>(</span><span class='symbol'>:logger</span><span class='rparen'>)</span> <span class='op'>?</span> <span class='const'>Rails</span><span class='period'>.</span><span class='id identifier rubyid_logger'>logger</span> <span class='op'>:</span> <span class='op'>::</span><span class='const'>Logger</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='gvar'>$stdout</span><span class='rparen'>)</span>
|
@@ -266,13 +279,15 @@
|
|
266
279
|
</div>
|
267
280
|
|
268
281
|
<div class="method_details ">
|
269
|
-
<
|
282
|
+
<h3 class="signature " id="logger-instance_method">
|
270
283
|
|
271
284
|
- (<tt>Object</tt>) <strong>logger</strong>
|
272
285
|
|
273
286
|
|
274
287
|
|
275
|
-
|
288
|
+
|
289
|
+
|
290
|
+
</h3><div class="docstring">
|
276
291
|
<div class="discussion">
|
277
292
|
<p>Returns the assigned logger instance.</p>
|
278
293
|
|
@@ -281,7 +296,7 @@
|
|
281
296
|
</div>
|
282
297
|
<div class="tags">
|
283
298
|
|
284
|
-
<
|
299
|
+
<p class="tag_title">Since:</p>
|
285
300
|
<ul class="since">
|
286
301
|
|
287
302
|
<li>
|
@@ -303,12 +318,12 @@
|
|
303
318
|
<pre class="lines">
|
304
319
|
|
305
320
|
|
306
|
-
|
307
|
-
|
308
|
-
|
321
|
+
40
|
322
|
+
41
|
323
|
+
42</pre>
|
309
324
|
</td>
|
310
325
|
<td>
|
311
|
-
<pre class="code"><span class="info file"># File 'lib/dynamoid/config.rb', line
|
326
|
+
<pre class="code"><span class="info file"># File 'lib/dynamoid/config.rb', line 40</span>
|
312
327
|
|
313
328
|
<span class='kw'>def</span> <span class='id identifier rubyid_logger'>logger</span>
|
314
329
|
<span class='ivar'>@logger</span> <span class='op'>||=</span> <span class='id identifier rubyid_default_logger'>default_logger</span>
|
@@ -319,13 +334,15 @@
|
|
319
334
|
</div>
|
320
335
|
|
321
336
|
<div class="method_details ">
|
322
|
-
<
|
337
|
+
<h3 class="signature " id="logger=-instance_method">
|
323
338
|
|
324
339
|
- (<tt>Object</tt>) <strong>logger=</strong>(logger)
|
325
340
|
|
326
341
|
|
327
342
|
|
328
|
-
|
343
|
+
|
344
|
+
|
345
|
+
</h3><div class="docstring">
|
329
346
|
<div class="discussion">
|
330
347
|
<p>If you want to, set the logger manually to any output you'd like. Or pass false or nil to disable logging entirely.</p>
|
331
348
|
|
@@ -334,7 +351,7 @@
|
|
334
351
|
</div>
|
335
352
|
<div class="tags">
|
336
353
|
|
337
|
-
<
|
354
|
+
<p class="tag_title">Since:</p>
|
338
355
|
<ul class="since">
|
339
356
|
|
340
357
|
<li>
|
@@ -356,17 +373,17 @@
|
|
356
373
|
<pre class="lines">
|
357
374
|
|
358
375
|
|
359
|
-
44
|
360
|
-
45
|
361
|
-
46
|
362
376
|
47
|
363
377
|
48
|
364
378
|
49
|
365
379
|
50
|
366
|
-
51
|
380
|
+
51
|
381
|
+
52
|
382
|
+
53
|
383
|
+
54</pre>
|
367
384
|
</td>
|
368
385
|
<td>
|
369
|
-
<pre class="code"><span class="info file"># File 'lib/dynamoid/config.rb', line
|
386
|
+
<pre class="code"><span class="info file"># File 'lib/dynamoid/config.rb', line 47</span>
|
370
387
|
|
371
388
|
<span class='kw'>def</span> <span class='id identifier rubyid_logger='>logger=</span><span class='lparen'>(</span><span class='id identifier rubyid_logger'>logger</span><span class='rparen'>)</span>
|
372
389
|
<span class='kw'>case</span> <span class='id identifier rubyid_logger'>logger</span>
|
@@ -384,11 +401,11 @@
|
|
384
401
|
</div>
|
385
402
|
|
386
403
|
</div>
|
387
|
-
|
404
|
+
|
388
405
|
<div id="footer">
|
389
|
-
Generated on Thu
|
406
|
+
Generated on Thu Jun 27 21:59:09 2013 by
|
390
407
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
391
|
-
0.
|
408
|
+
0.8.6.1 (ruby-1.9.3).
|
392
409
|
</div>
|
393
410
|
|
394
411
|
</body>
|
@@ -6,19 +6,21 @@
|
|
6
6
|
<title>
|
7
7
|
Module: Dynamoid::Config::Options
|
8
8
|
|
9
|
-
— Documentation by YARD 0.
|
9
|
+
— Documentation by YARD 0.8.6.1
|
10
10
|
|
11
11
|
</title>
|
12
12
|
|
13
|
-
<link rel="stylesheet" href="../../css/style.css" type="text/css"
|
13
|
+
<link rel="stylesheet" href="../../css/style.css" type="text/css" charset="utf-8" />
|
14
14
|
|
15
|
-
<link rel="stylesheet" href="../../css/common.css" type="text/css"
|
15
|
+
<link rel="stylesheet" href="../../css/common.css" type="text/css" charset="utf-8" />
|
16
16
|
|
17
17
|
<script type="text/javascript" charset="utf-8">
|
18
|
-
|
19
|
-
|
18
|
+
hasFrames = window.top.frames.main ? true : false;
|
19
|
+
relpath = '../../';
|
20
|
+
framesUrl = "../../frames.html#!" + escape(window.location.href);
|
20
21
|
</script>
|
21
22
|
|
23
|
+
|
22
24
|
<script type="text/javascript" charset="utf-8" src="../../js/jquery.js"></script>
|
23
25
|
|
24
26
|
<script type="text/javascript" charset="utf-8" src="../../js/app.js"></script>
|
@@ -26,36 +28,41 @@
|
|
26
28
|
|
27
29
|
</head>
|
28
30
|
<body>
|
29
|
-
<script type="text/javascript" charset="utf-8">
|
30
|
-
if (window.top.frames.main) document.body.className = 'frames';
|
31
|
-
</script>
|
32
|
-
|
33
31
|
<div id="header">
|
34
32
|
<div id="menu">
|
35
33
|
|
36
|
-
<a href="../../_index.html">Index (O)</a> »
|
34
|
+
<a href="../../_index.html">Index (O)</a> »
|
37
35
|
<span class='title'><span class='object_link'><a href="../../Dynamoid.html" title="Dynamoid (module)">Dynamoid</a></span></span> » <span class='title'><span class='object_link'><a href="../Config.html" title="Dynamoid::Config (module)">Config</a></span></span>
|
38
36
|
»
|
39
37
|
<span class="title">Options</span>
|
40
38
|
|
41
|
-
|
39
|
+
|
42
40
|
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
43
41
|
</div>
|
44
42
|
|
45
43
|
<div id="search">
|
46
44
|
|
47
|
-
<a
|
45
|
+
<a class="full_list_link" id="class_list_link"
|
46
|
+
href="../../class_list.html">
|
47
|
+
Class List
|
48
|
+
</a>
|
48
49
|
|
49
|
-
<a
|
50
|
+
<a class="full_list_link" id="method_list_link"
|
51
|
+
href="../../method_list.html">
|
52
|
+
Method List
|
53
|
+
</a>
|
50
54
|
|
51
|
-
<a
|
55
|
+
<a class="full_list_link" id="file_list_link"
|
56
|
+
href="../../file_list.html">
|
57
|
+
File List
|
58
|
+
</a>
|
52
59
|
|
53
60
|
</div>
|
54
61
|
<div class="clear"></div>
|
55
62
|
</div>
|
56
|
-
|
63
|
+
|
57
64
|
<iframe id="search_frame"></iframe>
|
58
|
-
|
65
|
+
|
59
66
|
<div id="content"><h1>Module: Dynamoid::Config::Options
|
60
67
|
|
61
68
|
|
@@ -120,6 +127,7 @@
|
|
120
127
|
|
121
128
|
|
122
129
|
|
130
|
+
|
123
131
|
|
124
132
|
|
125
133
|
<span class="summary_desc"><div class='inline'><p>Get the defaults or initialize a new empty hash.</p>
|
@@ -142,6 +150,7 @@
|
|
142
150
|
|
143
151
|
|
144
152
|
|
153
|
+
|
145
154
|
|
146
155
|
|
147
156
|
<span class="summary_desc"><div class='inline'><p>Define a configuration option with a default.</p>
|
@@ -164,6 +173,7 @@
|
|
164
173
|
|
165
174
|
|
166
175
|
|
176
|
+
|
167
177
|
|
168
178
|
|
169
179
|
<span class="summary_desc"><div class='inline'><p>Reset the configuration options to the defaults.</p>
|
@@ -186,6 +196,7 @@
|
|
186
196
|
|
187
197
|
|
188
198
|
|
199
|
+
|
189
200
|
|
190
201
|
|
191
202
|
<span class="summary_desc"><div class='inline'><p>Get the settings or initialize a new empty hash.</p>
|
@@ -201,16 +212,18 @@
|
|
201
212
|
|
202
213
|
<div id="instance_method_details" class="method_details_list">
|
203
214
|
<h2>Instance Method Details</h2>
|
204
|
-
|
215
|
+
|
205
216
|
|
206
217
|
<div class="method_details first">
|
207
|
-
<
|
218
|
+
<h3 class="signature first" id="defaults-instance_method">
|
208
219
|
|
209
220
|
- (<tt>Hash</tt>) <strong>defaults</strong>
|
210
221
|
|
211
222
|
|
212
223
|
|
213
|
-
|
224
|
+
|
225
|
+
|
226
|
+
</h3><div class="docstring">
|
214
227
|
<div class="discussion">
|
215
228
|
<p>Get the defaults or initialize a new empty hash.</p>
|
216
229
|
|
@@ -220,15 +233,17 @@
|
|
220
233
|
<div class="tags">
|
221
234
|
|
222
235
|
<div class="examples">
|
223
|
-
<
|
236
|
+
<p class="tag_title">Examples:</p>
|
224
237
|
|
225
|
-
|
226
|
-
|
227
|
-
|
238
|
+
|
239
|
+
<p class="example_title"><div class='inline'><p>Get the defaults.</p>
|
240
|
+
</div></p>
|
241
|
+
|
242
|
+
<pre class="example code"><code><span class='id identifier rubyid_options'>options</span><span class='period'>.</span><span class='id identifier rubyid_defaults'>defaults</span></code></pre>
|
228
243
|
|
229
244
|
</div>
|
230
245
|
|
231
|
-
<
|
246
|
+
<p class="tag_title">Returns:</p>
|
232
247
|
<ul class="return">
|
233
248
|
|
234
249
|
<li>
|
@@ -245,7 +260,7 @@
|
|
245
260
|
</li>
|
246
261
|
|
247
262
|
</ul>
|
248
|
-
<
|
263
|
+
<p class="tag_title">Since:</p>
|
249
264
|
<ul class="since">
|
250
265
|
|
251
266
|
<li>
|
@@ -283,13 +298,15 @@
|
|
283
298
|
</div>
|
284
299
|
|
285
300
|
<div class="method_details ">
|
286
|
-
<
|
301
|
+
<h3 class="signature " id="option-instance_method">
|
287
302
|
|
288
303
|
- (<tt>Object</tt>) <strong>option</strong>(name, options = {})
|
289
304
|
|
290
305
|
|
291
306
|
|
292
|
-
|
307
|
+
|
308
|
+
|
309
|
+
</h3><div class="docstring">
|
293
310
|
<div class="discussion">
|
294
311
|
<p>Define a configuration option with a default.</p>
|
295
312
|
|
@@ -299,14 +316,16 @@
|
|
299
316
|
<div class="tags">
|
300
317
|
|
301
318
|
<div class="examples">
|
302
|
-
<
|
319
|
+
<p class="tag_title">Examples:</p>
|
303
320
|
|
304
|
-
|
305
|
-
|
306
|
-
|
321
|
+
|
322
|
+
<p class="example_title"><div class='inline'><p>Define the option.</p>
|
323
|
+
</div></p>
|
324
|
+
|
325
|
+
<pre class="example code"><code><span class='const'>Options</span><span class='period'>.</span><span class='id identifier rubyid_option'>option</span><span class='lparen'>(</span><span class='symbol'>:persist_in_safe_mode</span><span class='comma'>,</span> <span class='symbol'>:default</span> <span class='op'>=></span> <span class='kw'>false</span><span class='rparen'>)</span></code></pre>
|
307
326
|
|
308
327
|
</div>
|
309
|
-
<
|
328
|
+
<p class="tag_title">Parameters:</p>
|
310
329
|
<ul class="param">
|
311
330
|
|
312
331
|
<li>
|
@@ -348,7 +367,7 @@
|
|
348
367
|
|
349
368
|
|
350
369
|
|
351
|
-
<
|
370
|
+
<p class="tag_title">Options Hash (<tt>options</tt>):</p>
|
352
371
|
<ul class="option">
|
353
372
|
|
354
373
|
<li>
|
@@ -357,14 +376,16 @@
|
|
357
376
|
<span class="default">
|
358
377
|
|
359
378
|
</span>
|
360
|
-
|
379
|
+
|
380
|
+
— <div class='inline'><p>The default value.</p>
|
361
381
|
</div>
|
382
|
+
|
362
383
|
</li>
|
363
384
|
|
364
385
|
</ul>
|
365
386
|
|
366
387
|
|
367
|
-
<
|
388
|
+
<p class="tag_title">Since:</p>
|
368
389
|
<ul class="since">
|
369
390
|
|
370
391
|
<li>
|
@@ -416,19 +437,19 @@
|
|
416
437
|
|
417
438
|
<span class='id identifier rubyid_class_eval'>class_eval</span> <span class='heredoc_beg'><<-RUBY</span>
|
418
439
|
<span class='tstring_content'> def </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_name'>name</span><span class='rbrace'>}</span><span class='tstring_content'>
|
419
|
-
</span><span class='embexpr_beg'
|
440
|
+
settings[</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_name'>name</span><span class='period'>.</span><span class='id identifier rubyid_inspect'>inspect</span><span class='rbrace'>}</span><span class='tstring_content'>]
|
420
441
|
end
|
421
442
|
|
422
|
-
</span><span class='embexpr_beg'
|
423
|
-
</span><span class='embexpr_beg'
|
443
|
+
def </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_name'>name</span><span class='rbrace'>}</span><span class='tstring_content'>=(value)
|
444
|
+
settings[</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_name'>name</span><span class='period'>.</span><span class='id identifier rubyid_inspect'>inspect</span><span class='rbrace'>}</span><span class='tstring_content'>] = value
|
424
445
|
end
|
425
446
|
|
426
|
-
</span><span class='embexpr_beg'
|
427
|
-
</span><span class='embexpr_beg'
|
447
|
+
def </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_name'>name</span><span class='rbrace'>}</span><span class='tstring_content'>?
|
448
|
+
</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_name'>name</span><span class='rbrace'>}</span><span class='tstring_content'>
|
428
449
|
end
|
429
450
|
|
430
|
-
</span><span class='embexpr_beg'
|
431
|
-
</span><span class='embexpr_beg'
|
451
|
+
def reset_</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_name'>name</span><span class='rbrace'>}</span><span class='tstring_content'>
|
452
|
+
settings[</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_name'>name</span><span class='period'>.</span><span class='id identifier rubyid_inspect'>inspect</span><span class='rbrace'>}</span><span class='tstring_content'>] = defaults[</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_name'>name</span><span class='period'>.</span><span class='id identifier rubyid_inspect'>inspect</span><span class='rbrace'>}</span><span class='tstring_content'>]
|
432
453
|
end
|
433
454
|
</span><span class='heredoc_end'> RUBY
|
434
455
|
</span><span class='kw'>end</span></pre>
|
@@ -438,13 +459,15 @@
|
|
438
459
|
</div>
|
439
460
|
|
440
461
|
<div class="method_details ">
|
441
|
-
<
|
462
|
+
<h3 class="signature " id="reset-instance_method">
|
442
463
|
|
443
464
|
- (<tt>Hash</tt>) <strong>reset</strong>
|
444
465
|
|
445
466
|
|
446
467
|
|
447
|
-
|
468
|
+
|
469
|
+
|
470
|
+
</h3><div class="docstring">
|
448
471
|
<div class="discussion">
|
449
472
|
<p>Reset the configuration options to the defaults.</p>
|
450
473
|
|
@@ -454,15 +477,17 @@
|
|
454
477
|
<div class="tags">
|
455
478
|
|
456
479
|
<div class="examples">
|
457
|
-
<
|
480
|
+
<p class="tag_title">Examples:</p>
|
458
481
|
|
459
|
-
|
460
|
-
|
461
|
-
|
482
|
+
|
483
|
+
<p class="example_title"><div class='inline'><p>Reset the configuration options.</p>
|
484
|
+
</div></p>
|
485
|
+
|
486
|
+
<pre class="example code"><code><span class='id identifier rubyid_config'>config</span><span class='period'>.</span><span class='id identifier rubyid_reset'>reset</span></code></pre>
|
462
487
|
|
463
488
|
</div>
|
464
489
|
|
465
|
-
<
|
490
|
+
<p class="tag_title">Returns:</p>
|
466
491
|
<ul class="return">
|
467
492
|
|
468
493
|
<li>
|
@@ -479,7 +504,7 @@
|
|
479
504
|
</li>
|
480
505
|
|
481
506
|
</ul>
|
482
|
-
<
|
507
|
+
<p class="tag_title">Since:</p>
|
483
508
|
<ul class="since">
|
484
509
|
|
485
510
|
<li>
|
@@ -517,13 +542,15 @@
|
|
517
542
|
</div>
|
518
543
|
|
519
544
|
<div class="method_details ">
|
520
|
-
<
|
545
|
+
<h3 class="signature " id="settings-instance_method">
|
521
546
|
|
522
547
|
- (<tt>Hash</tt>) <strong>settings</strong>
|
523
548
|
|
524
549
|
|
525
550
|
|
526
|
-
|
551
|
+
|
552
|
+
|
553
|
+
</h3><div class="docstring">
|
527
554
|
<div class="discussion">
|
528
555
|
<p>Get the settings or initialize a new empty hash.</p>
|
529
556
|
|
@@ -533,15 +560,17 @@
|
|
533
560
|
<div class="tags">
|
534
561
|
|
535
562
|
<div class="examples">
|
536
|
-
<
|
563
|
+
<p class="tag_title">Examples:</p>
|
537
564
|
|
538
|
-
|
539
|
-
|
540
|
-
|
565
|
+
|
566
|
+
<p class="example_title"><div class='inline'><p>Get the settings.</p>
|
567
|
+
</div></p>
|
568
|
+
|
569
|
+
<pre class="example code"><code><span class='id identifier rubyid_options'>options</span><span class='period'>.</span><span class='id identifier rubyid_settings'>settings</span></code></pre>
|
541
570
|
|
542
571
|
</div>
|
543
572
|
|
544
|
-
<
|
573
|
+
<p class="tag_title">Returns:</p>
|
545
574
|
<ul class="return">
|
546
575
|
|
547
576
|
<li>
|
@@ -558,7 +587,7 @@
|
|
558
587
|
</li>
|
559
588
|
|
560
589
|
</ul>
|
561
|
-
<
|
590
|
+
<p class="tag_title">Since:</p>
|
562
591
|
<ul class="since">
|
563
592
|
|
564
593
|
<li>
|
@@ -598,11 +627,11 @@
|
|
598
627
|
</div>
|
599
628
|
|
600
629
|
</div>
|
601
|
-
|
630
|
+
|
602
631
|
<div id="footer">
|
603
|
-
Generated on Thu
|
632
|
+
Generated on Thu Jun 27 21:59:13 2013 by
|
604
633
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
605
|
-
0.
|
634
|
+
0.8.6.1 (ruby-1.9.3).
|
606
635
|
</div>
|
607
636
|
|
608
637
|
</body>
|