redis_object 0.5.0 → 1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +0 -2
- data/Gemfile +0 -4
- data/README.markdown +15 -24
- data/Rakefile +0 -8
- data/doc/Object.html +185 -0
- data/doc/Seabright.html +181 -0
- data/doc/Seabright/Adapter.html +442 -0
- data/doc/Seabright/Collection.html +797 -0
- data/doc/Seabright/Collections.html +635 -0
- data/doc/Seabright/Collections/ClassMethods.html +212 -0
- data/doc/Seabright/ExternalIndex.html +217 -0
- data/doc/Seabright/History.html +382 -0
- data/doc/Seabright/History/ClassMethods.html +276 -0
- data/doc/Seabright/Indices.html +324 -0
- data/doc/Seabright/Indices/ClassMethods.html +348 -0
- data/doc/Seabright/Keys.html +314 -0
- data/doc/Seabright/Keys/ClassMethods.html +276 -0
- data/doc/Seabright/ObjectBase.html +852 -0
- data/doc/Seabright/ObjectBase/ClassMethods.html +677 -0
- data/doc/Seabright/RedisObject.html +230 -0
- data/doc/Seabright/References.html +280 -0
- data/doc/Seabright/Storage.html +252 -0
- data/doc/Seabright/Storage/ClassMethods.html +276 -0
- data/doc/Seabright/Storage/MySQL.html +442 -0
- data/doc/Seabright/Storage/Redis.html +218 -0
- data/doc/Seabright/Template.html +212 -0
- data/doc/Seabright/Template/ClassMethods.html +166 -0
- data/doc/Seabright/Timestamps.html +292 -0
- data/doc/Seabright/Timestamps/ClassMethods.html +214 -0
- data/doc/Seabright/Types.html +410 -0
- data/doc/Seabright/Types/ClassMethods.html +308 -0
- data/doc/created.rid +17 -0
- data/doc/images/add.png +0 -0
- data/doc/images/brick.png +0 -0
- data/doc/images/brick_link.png +0 -0
- data/doc/images/bug.png +0 -0
- data/doc/images/bullet_black.png +0 -0
- data/doc/images/bullet_toggle_minus.png +0 -0
- data/doc/images/bullet_toggle_plus.png +0 -0
- data/doc/images/date.png +0 -0
- data/doc/images/delete.png +0 -0
- data/doc/images/find.png +0 -0
- data/doc/images/loadingAnimation.gif +0 -0
- data/doc/images/macFFBgHack.png +0 -0
- data/doc/images/package.png +0 -0
- data/doc/images/page_green.png +0 -0
- data/doc/images/page_white_text.png +0 -0
- data/doc/images/page_white_width.png +0 -0
- data/doc/images/plugin.png +0 -0
- data/doc/images/ruby.png +0 -0
- data/doc/images/tag_blue.png +0 -0
- data/doc/images/tag_green.png +0 -0
- data/doc/images/transparent.png +0 -0
- data/doc/images/wrench.png +0 -0
- data/doc/images/wrench_orange.png +0 -0
- data/doc/images/zoom.png +0 -0
- data/doc/index.html +125 -0
- data/doc/js/darkfish.js +153 -0
- data/doc/js/jquery.js +18 -0
- data/doc/js/navigation.js +142 -0
- data/doc/js/search.js +94 -0
- data/doc/js/search_index.js +1 -0
- data/doc/js/searcher.js +228 -0
- data/doc/rdoc.css +543 -0
- data/doc/table_of_contents.html +394 -0
- data/lib/redis_object.rb +1 -11
- data/lib/redis_object/base.rb +60 -210
- data/lib/redis_object/collection.rb +100 -130
- data/lib/redis_object/defaults.rb +8 -21
- data/lib/redis_object/ext/filters.rb +16 -34
- data/lib/redis_object/ext/triggers.rb +13 -75
- data/lib/redis_object/{experimental/history.rb → history.rb} +0 -0
- data/lib/redis_object/indices.rb +39 -44
- data/lib/redis_object/keys.rb +4 -4
- data/lib/redis_object/storage.rb +1 -30
- data/lib/redis_object/storage/adapter.rb +3 -6
- data/lib/redis_object/storage/redis.rb +3 -98
- data/lib/redis_object/timestamps.rb +21 -42
- data/lib/redis_object/types.rb +30 -172
- data/lib/redis_object/version.rb +1 -1
- data/redis_object.gemspec +0 -1
- data/spec/base_spec.rb +6 -41
- data/spec/spec_helper.rb +1 -32
- metadata +116 -111
- data/.coveralls.yml +0 -1
- data/.travis.yml +0 -5
- data/lib/redis_object/ext/script_cache.rb +0 -92
- data/lib/redis_object/ext/shardable.rb +0 -18
- data/lib/redis_object/ext/view_caching.rb +0 -258
- data/lib/redis_object/ext/views.rb +0 -102
- data/lib/redis_object/inheritance_tracking.rb +0 -23
- data/spec/adapter_spec.rb +0 -43
- data/spec/benchmark_spec.rb +0 -46
- data/spec/collections_spec.rb +0 -144
- data/spec/defaults_spec.rb +0 -56
- data/spec/filters_spec.rb +0 -29
- data/spec/indices_spec.rb +0 -45
- data/spec/rename_class_spec.rb +0 -96
- data/spec/timestamp_spec.rb +0 -28
- data/spec/trigger_spec.rb +0 -51
- data/spec/types_spec.rb +0 -103
- data/spec/view_caching_spec.rb +0 -130
- data/spec/views_spec.rb +0 -72
@@ -0,0 +1,442 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
|
3
|
+
<html>
|
4
|
+
<head>
|
5
|
+
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
|
6
|
+
|
7
|
+
<title>class Seabright::Adapter - StubbornObject</title>
|
8
|
+
|
9
|
+
<link type="text/css" media="screen" href="../rdoc.css" rel="stylesheet">
|
10
|
+
|
11
|
+
<script type="text/javascript">
|
12
|
+
var rdoc_rel_prefix = "../";
|
13
|
+
</script>
|
14
|
+
|
15
|
+
<script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
|
16
|
+
<script type="text/javascript" charset="utf-8" src="../js/navigation.js"></script>
|
17
|
+
<script type="text/javascript" charset="utf-8" src="../js/search_index.js"></script>
|
18
|
+
<script type="text/javascript" charset="utf-8" src="../js/search.js"></script>
|
19
|
+
<script type="text/javascript" charset="utf-8" src="../js/searcher.js"></script>
|
20
|
+
<script type="text/javascript" charset="utf-8" src="../js/darkfish.js"></script>
|
21
|
+
|
22
|
+
|
23
|
+
<body id="top" class="class">
|
24
|
+
<nav id="metadata">
|
25
|
+
<nav id="home-section" class="section">
|
26
|
+
<h3 class="section-header">
|
27
|
+
<a href="../index.html">Home</a>
|
28
|
+
<a href="../table_of_contents.html#classes">Classes</a>
|
29
|
+
<a href="../table_of_contents.html#methods">Methods</a>
|
30
|
+
</h3>
|
31
|
+
</nav>
|
32
|
+
|
33
|
+
|
34
|
+
<nav id="search-section" class="section project-section" class="initially-hidden">
|
35
|
+
<form action="#" method="get" accept-charset="utf-8">
|
36
|
+
<h3 class="section-header">
|
37
|
+
<input type="text" name="search" placeholder="Search" id="search-field"
|
38
|
+
title="Type to search, Up and Down to navigate, Enter to load">
|
39
|
+
</h3>
|
40
|
+
</form>
|
41
|
+
|
42
|
+
<ul id="search-results" class="initially-hidden"></ul>
|
43
|
+
</nav>
|
44
|
+
|
45
|
+
|
46
|
+
<div id="file-metadata">
|
47
|
+
<nav id="file-list-section" class="section">
|
48
|
+
<h3 class="section-header">Defined In</h3>
|
49
|
+
<ul>
|
50
|
+
<li>lib/redis_object/storage/adapter.rb
|
51
|
+
</ul>
|
52
|
+
</nav>
|
53
|
+
|
54
|
+
|
55
|
+
</div>
|
56
|
+
|
57
|
+
<div id="class-metadata">
|
58
|
+
|
59
|
+
<nav id="parent-class-section" class="section">
|
60
|
+
<h3 class="section-header">Parent</h3>
|
61
|
+
|
62
|
+
<p class="link"><a href="../Object.html">Object</a>
|
63
|
+
|
64
|
+
</nav>
|
65
|
+
|
66
|
+
|
67
|
+
<!-- Method Quickref -->
|
68
|
+
<nav id="method-list-section" class="section">
|
69
|
+
<h3 class="section-header">Methods</h3>
|
70
|
+
|
71
|
+
<ul class="link-list">
|
72
|
+
|
73
|
+
<li><a href="#method-i-del">#del</a>
|
74
|
+
|
75
|
+
<li><a href="#method-i-exists">#exists</a>
|
76
|
+
|
77
|
+
<li><a href="#method-i-hget">#hget</a>
|
78
|
+
|
79
|
+
<li><a href="#method-i-hset">#hset</a>
|
80
|
+
|
81
|
+
<li><a href="#method-i-sadd">#sadd</a>
|
82
|
+
|
83
|
+
<li><a href="#method-i-set">#set</a>
|
84
|
+
|
85
|
+
<li><a href="#method-i-smembers">#smembers</a>
|
86
|
+
|
87
|
+
<li><a href="#method-i-srem">#srem</a>
|
88
|
+
|
89
|
+
</ul>
|
90
|
+
</nav>
|
91
|
+
|
92
|
+
</div>
|
93
|
+
|
94
|
+
<div id="project-metadata">
|
95
|
+
|
96
|
+
<nav id="classindex-section" class="section project-section">
|
97
|
+
<h3 class="section-header">Class and Module Index</h3>
|
98
|
+
|
99
|
+
<ul class="link-list">
|
100
|
+
|
101
|
+
<li><a href="../Seabright.html">Seabright</a>
|
102
|
+
|
103
|
+
<li><a href="../Seabright/Adapter.html">Seabright::Adapter</a>
|
104
|
+
|
105
|
+
<li><a href="../Seabright/Collection.html">Seabright::Collection</a>
|
106
|
+
|
107
|
+
<li><a href="../Seabright/Collections.html">Seabright::Collections</a>
|
108
|
+
|
109
|
+
<li><a href="../Seabright/Collections/ClassMethods.html">Seabright::Collections::ClassMethods</a>
|
110
|
+
|
111
|
+
<li><a href="../Seabright/ExternalIndex.html">Seabright::ExternalIndex</a>
|
112
|
+
|
113
|
+
<li><a href="../Seabright/History.html">Seabright::History</a>
|
114
|
+
|
115
|
+
<li><a href="../Seabright/History/ClassMethods.html">Seabright::History::ClassMethods</a>
|
116
|
+
|
117
|
+
<li><a href="../Seabright/Indices.html">Seabright::Indices</a>
|
118
|
+
|
119
|
+
<li><a href="../Seabright/Indices/ClassMethods.html">Seabright::Indices::ClassMethods</a>
|
120
|
+
|
121
|
+
<li><a href="../Seabright/Keys.html">Seabright::Keys</a>
|
122
|
+
|
123
|
+
<li><a href="../Seabright/Keys/ClassMethods.html">Seabright::Keys::ClassMethods</a>
|
124
|
+
|
125
|
+
<li><a href="../Seabright/ObjectBase.html">Seabright::ObjectBase</a>
|
126
|
+
|
127
|
+
<li><a href="../Seabright/ObjectBase/ClassMethods.html">Seabright::ObjectBase::ClassMethods</a>
|
128
|
+
|
129
|
+
<li><a href="../Seabright/RedisObject.html">Seabright::RedisObject</a>
|
130
|
+
|
131
|
+
<li><a href="../Seabright/RedisObject.html">Seabright::RedisObject</a>
|
132
|
+
|
133
|
+
<li><a href="../Seabright/References.html">Seabright::References</a>
|
134
|
+
|
135
|
+
<li><a href="../Seabright/Storage.html">Seabright::Storage</a>
|
136
|
+
|
137
|
+
<li><a href="../Seabright/Storage/ClassMethods.html">Seabright::Storage::ClassMethods</a>
|
138
|
+
|
139
|
+
<li><a href="../Seabright/Storage/MySQL.html">Seabright::Storage::MySQL</a>
|
140
|
+
|
141
|
+
<li><a href="../Seabright/Storage/Redis.html">Seabright::Storage::Redis</a>
|
142
|
+
|
143
|
+
<li><a href="../Seabright/Template.html">Seabright::Template</a>
|
144
|
+
|
145
|
+
<li><a href="../Seabright/Template/ClassMethods.html">Seabright::Template::ClassMethods</a>
|
146
|
+
|
147
|
+
<li><a href="../Seabright/Timestamps.html">Seabright::Timestamps</a>
|
148
|
+
|
149
|
+
<li><a href="../Seabright/Timestamps/ClassMethods.html">Seabright::Timestamps::ClassMethods</a>
|
150
|
+
|
151
|
+
<li><a href="../Seabright/Types.html">Seabright::Types</a>
|
152
|
+
|
153
|
+
<li><a href="../Seabright/Types/ClassMethods.html">Seabright::Types::ClassMethods</a>
|
154
|
+
|
155
|
+
<li><a href="../Object.html">Object</a>
|
156
|
+
|
157
|
+
<li><a href="../Seabright/RedisObject.html">Object::RedisObject</a>
|
158
|
+
|
159
|
+
</ul>
|
160
|
+
</nav>
|
161
|
+
|
162
|
+
</div>
|
163
|
+
</nav>
|
164
|
+
|
165
|
+
<div id="documentation">
|
166
|
+
<h1 class="class">class Seabright::Adapter</h1>
|
167
|
+
|
168
|
+
<div id="description" class="description">
|
169
|
+
|
170
|
+
</div><!-- description -->
|
171
|
+
|
172
|
+
|
173
|
+
|
174
|
+
|
175
|
+
<section id="5Buntitled-5D" class="documentation-section">
|
176
|
+
|
177
|
+
|
178
|
+
|
179
|
+
|
180
|
+
|
181
|
+
|
182
|
+
|
183
|
+
|
184
|
+
<!-- Methods -->
|
185
|
+
|
186
|
+
<section id="public-instance-5Buntitled-5D-method-details" class="method-section section">
|
187
|
+
<h3 class="section-header">Public Instance Methods</h3>
|
188
|
+
|
189
|
+
|
190
|
+
<div id="method-i-del" class="method-detail ">
|
191
|
+
|
192
|
+
<div class="method-heading">
|
193
|
+
<span class="method-name">del</span><span
|
194
|
+
class="method-args">()</span>
|
195
|
+
<span class="method-click-advice">click to toggle source</span>
|
196
|
+
</div>
|
197
|
+
|
198
|
+
|
199
|
+
<div class="method-description">
|
200
|
+
|
201
|
+
|
202
|
+
|
203
|
+
|
204
|
+
|
205
|
+
<div class="method-source-code" id="del-source">
|
206
|
+
<pre><span class="ruby-comment"># File lib/redis_object/storage/adapter.rb, line 12</span>
|
207
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">del</span>
|
208
|
+
|
209
|
+
<span class="ruby-keyword">end</span></pre>
|
210
|
+
</div><!-- del-source -->
|
211
|
+
|
212
|
+
</div>
|
213
|
+
|
214
|
+
|
215
|
+
|
216
|
+
|
217
|
+
</div><!-- del-method -->
|
218
|
+
|
219
|
+
|
220
|
+
<div id="method-i-exists" class="method-detail ">
|
221
|
+
|
222
|
+
<div class="method-heading">
|
223
|
+
<span class="method-name">exists</span><span
|
224
|
+
class="method-args">()</span>
|
225
|
+
<span class="method-click-advice">click to toggle source</span>
|
226
|
+
</div>
|
227
|
+
|
228
|
+
|
229
|
+
<div class="method-description">
|
230
|
+
|
231
|
+
|
232
|
+
|
233
|
+
|
234
|
+
|
235
|
+
<div class="method-source-code" id="exists-source">
|
236
|
+
<pre><span class="ruby-comment"># File lib/redis_object/storage/adapter.rb, line 24</span>
|
237
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">exists</span>
|
238
|
+
|
239
|
+
<span class="ruby-keyword">end</span></pre>
|
240
|
+
</div><!-- exists-source -->
|
241
|
+
|
242
|
+
</div>
|
243
|
+
|
244
|
+
|
245
|
+
|
246
|
+
|
247
|
+
</div><!-- exists-method -->
|
248
|
+
|
249
|
+
|
250
|
+
<div id="method-i-hget" class="method-detail ">
|
251
|
+
|
252
|
+
<div class="method-heading">
|
253
|
+
<span class="method-name">hget</span><span
|
254
|
+
class="method-args">()</span>
|
255
|
+
<span class="method-click-advice">click to toggle source</span>
|
256
|
+
</div>
|
257
|
+
|
258
|
+
|
259
|
+
<div class="method-description">
|
260
|
+
|
261
|
+
|
262
|
+
|
263
|
+
|
264
|
+
|
265
|
+
<div class="method-source-code" id="hget-source">
|
266
|
+
<pre><span class="ruby-comment"># File lib/redis_object/storage/adapter.rb, line 28</span>
|
267
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">hget</span>
|
268
|
+
|
269
|
+
<span class="ruby-keyword">end</span></pre>
|
270
|
+
</div><!-- hget-source -->
|
271
|
+
|
272
|
+
</div>
|
273
|
+
|
274
|
+
|
275
|
+
|
276
|
+
|
277
|
+
</div><!-- hget-method -->
|
278
|
+
|
279
|
+
|
280
|
+
<div id="method-i-hset" class="method-detail ">
|
281
|
+
|
282
|
+
<div class="method-heading">
|
283
|
+
<span class="method-name">hset</span><span
|
284
|
+
class="method-args">()</span>
|
285
|
+
<span class="method-click-advice">click to toggle source</span>
|
286
|
+
</div>
|
287
|
+
|
288
|
+
|
289
|
+
<div class="method-description">
|
290
|
+
|
291
|
+
|
292
|
+
|
293
|
+
|
294
|
+
|
295
|
+
<div class="method-source-code" id="hset-source">
|
296
|
+
<pre><span class="ruby-comment"># File lib/redis_object/storage/adapter.rb, line 32</span>
|
297
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">hset</span>
|
298
|
+
|
299
|
+
<span class="ruby-keyword">end</span></pre>
|
300
|
+
</div><!-- hset-source -->
|
301
|
+
|
302
|
+
</div>
|
303
|
+
|
304
|
+
|
305
|
+
|
306
|
+
|
307
|
+
</div><!-- hset-method -->
|
308
|
+
|
309
|
+
|
310
|
+
<div id="method-i-sadd" class="method-detail ">
|
311
|
+
|
312
|
+
<div class="method-heading">
|
313
|
+
<span class="method-name">sadd</span><span
|
314
|
+
class="method-args">()</span>
|
315
|
+
<span class="method-click-advice">click to toggle source</span>
|
316
|
+
</div>
|
317
|
+
|
318
|
+
|
319
|
+
<div class="method-description">
|
320
|
+
|
321
|
+
|
322
|
+
|
323
|
+
|
324
|
+
|
325
|
+
<div class="method-source-code" id="sadd-source">
|
326
|
+
<pre><span class="ruby-comment"># File lib/redis_object/storage/adapter.rb, line 8</span>
|
327
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">sadd</span>
|
328
|
+
|
329
|
+
<span class="ruby-keyword">end</span></pre>
|
330
|
+
</div><!-- sadd-source -->
|
331
|
+
|
332
|
+
</div>
|
333
|
+
|
334
|
+
|
335
|
+
|
336
|
+
|
337
|
+
</div><!-- sadd-method -->
|
338
|
+
|
339
|
+
|
340
|
+
<div id="method-i-set" class="method-detail ">
|
341
|
+
|
342
|
+
<div class="method-heading">
|
343
|
+
<span class="method-name">set</span><span
|
344
|
+
class="method-args">()</span>
|
345
|
+
<span class="method-click-advice">click to toggle source</span>
|
346
|
+
</div>
|
347
|
+
|
348
|
+
|
349
|
+
<div class="method-description">
|
350
|
+
|
351
|
+
|
352
|
+
|
353
|
+
|
354
|
+
|
355
|
+
<div class="method-source-code" id="set-source">
|
356
|
+
<pre><span class="ruby-comment"># File lib/redis_object/storage/adapter.rb, line 4</span>
|
357
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">set</span>
|
358
|
+
|
359
|
+
<span class="ruby-keyword">end</span></pre>
|
360
|
+
</div><!-- set-source -->
|
361
|
+
|
362
|
+
</div>
|
363
|
+
|
364
|
+
|
365
|
+
|
366
|
+
|
367
|
+
</div><!-- set-method -->
|
368
|
+
|
369
|
+
|
370
|
+
<div id="method-i-smembers" class="method-detail ">
|
371
|
+
|
372
|
+
<div class="method-heading">
|
373
|
+
<span class="method-name">smembers</span><span
|
374
|
+
class="method-args">()</span>
|
375
|
+
<span class="method-click-advice">click to toggle source</span>
|
376
|
+
</div>
|
377
|
+
|
378
|
+
|
379
|
+
<div class="method-description">
|
380
|
+
|
381
|
+
|
382
|
+
|
383
|
+
|
384
|
+
|
385
|
+
<div class="method-source-code" id="smembers-source">
|
386
|
+
<pre><span class="ruby-comment"># File lib/redis_object/storage/adapter.rb, line 20</span>
|
387
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">smembers</span>
|
388
|
+
|
389
|
+
<span class="ruby-keyword">end</span></pre>
|
390
|
+
</div><!-- smembers-source -->
|
391
|
+
|
392
|
+
</div>
|
393
|
+
|
394
|
+
|
395
|
+
|
396
|
+
|
397
|
+
</div><!-- smembers-method -->
|
398
|
+
|
399
|
+
|
400
|
+
<div id="method-i-srem" class="method-detail ">
|
401
|
+
|
402
|
+
<div class="method-heading">
|
403
|
+
<span class="method-name">srem</span><span
|
404
|
+
class="method-args">()</span>
|
405
|
+
<span class="method-click-advice">click to toggle source</span>
|
406
|
+
</div>
|
407
|
+
|
408
|
+
|
409
|
+
<div class="method-description">
|
410
|
+
|
411
|
+
|
412
|
+
|
413
|
+
|
414
|
+
|
415
|
+
<div class="method-source-code" id="srem-source">
|
416
|
+
<pre><span class="ruby-comment"># File lib/redis_object/storage/adapter.rb, line 16</span>
|
417
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">srem</span>
|
418
|
+
|
419
|
+
<span class="ruby-keyword">end</span></pre>
|
420
|
+
</div><!-- srem-source -->
|
421
|
+
|
422
|
+
</div>
|
423
|
+
|
424
|
+
|
425
|
+
|
426
|
+
|
427
|
+
</div><!-- srem-method -->
|
428
|
+
|
429
|
+
|
430
|
+
</section><!-- public-instance-method-details -->
|
431
|
+
|
432
|
+
</section><!-- 5Buntitled-5D -->
|
433
|
+
|
434
|
+
</div><!-- documentation -->
|
435
|
+
|
436
|
+
|
437
|
+
<footer id="validator-badges">
|
438
|
+
<p><a href="http://validator.w3.org/check/referer">[Validate]</a>
|
439
|
+
<p>Generated by <a href="https://github.com/rdoc/rdoc">RDoc</a> 3.12.
|
440
|
+
<p>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish Rdoc Generator</a> 3.
|
441
|
+
</footer>
|
442
|
+
|
@@ -0,0 +1,797 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
|
3
|
+
<html>
|
4
|
+
<head>
|
5
|
+
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
|
6
|
+
|
7
|
+
<title>class Seabright::Collection - StubbornObject</title>
|
8
|
+
|
9
|
+
<link type="text/css" media="screen" href="../rdoc.css" rel="stylesheet">
|
10
|
+
|
11
|
+
<script type="text/javascript">
|
12
|
+
var rdoc_rel_prefix = "../";
|
13
|
+
</script>
|
14
|
+
|
15
|
+
<script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
|
16
|
+
<script type="text/javascript" charset="utf-8" src="../js/navigation.js"></script>
|
17
|
+
<script type="text/javascript" charset="utf-8" src="../js/search_index.js"></script>
|
18
|
+
<script type="text/javascript" charset="utf-8" src="../js/search.js"></script>
|
19
|
+
<script type="text/javascript" charset="utf-8" src="../js/searcher.js"></script>
|
20
|
+
<script type="text/javascript" charset="utf-8" src="../js/darkfish.js"></script>
|
21
|
+
|
22
|
+
|
23
|
+
<body id="top" class="class">
|
24
|
+
<nav id="metadata">
|
25
|
+
<nav id="home-section" class="section">
|
26
|
+
<h3 class="section-header">
|
27
|
+
<a href="../index.html">Home</a>
|
28
|
+
<a href="../table_of_contents.html#classes">Classes</a>
|
29
|
+
<a href="../table_of_contents.html#methods">Methods</a>
|
30
|
+
</h3>
|
31
|
+
</nav>
|
32
|
+
|
33
|
+
|
34
|
+
<nav id="search-section" class="section project-section" class="initially-hidden">
|
35
|
+
<form action="#" method="get" accept-charset="utf-8">
|
36
|
+
<h3 class="section-header">
|
37
|
+
<input type="text" name="search" placeholder="Search" id="search-field"
|
38
|
+
title="Type to search, Up and Down to navigate, Enter to load">
|
39
|
+
</h3>
|
40
|
+
</form>
|
41
|
+
|
42
|
+
<ul id="search-results" class="initially-hidden"></ul>
|
43
|
+
</nav>
|
44
|
+
|
45
|
+
|
46
|
+
<div id="file-metadata">
|
47
|
+
<nav id="file-list-section" class="section">
|
48
|
+
<h3 class="section-header">Defined In</h3>
|
49
|
+
<ul>
|
50
|
+
<li>lib/redis_object/collection.rb
|
51
|
+
</ul>
|
52
|
+
</nav>
|
53
|
+
|
54
|
+
|
55
|
+
</div>
|
56
|
+
|
57
|
+
<div id="class-metadata">
|
58
|
+
|
59
|
+
<nav id="parent-class-section" class="section">
|
60
|
+
<h3 class="section-header">Parent</h3>
|
61
|
+
|
62
|
+
<p class="link">Array
|
63
|
+
|
64
|
+
</nav>
|
65
|
+
|
66
|
+
|
67
|
+
<!-- Method Quickref -->
|
68
|
+
<nav id="method-list-section" class="section">
|
69
|
+
<h3 class="section-header">Methods</h3>
|
70
|
+
|
71
|
+
<ul class="link-list">
|
72
|
+
|
73
|
+
<li><a href="#method-c-load">::load</a>
|
74
|
+
|
75
|
+
<li><a href="#method-c-new">::new</a>
|
76
|
+
|
77
|
+
<li><a href="#method-i-3C-3C">#<<</a>
|
78
|
+
|
79
|
+
<li><a href="#method-i-5B-5D">#[]</a>
|
80
|
+
|
81
|
+
<li><a href="#method-i-class_const">#class_const</a>
|
82
|
+
|
83
|
+
<li><a href="#method-i-delete">#delete</a>
|
84
|
+
|
85
|
+
<li><a href="#method-i-each">#each</a>
|
86
|
+
|
87
|
+
<li><a href="#method-i-find">#find</a>
|
88
|
+
|
89
|
+
<li><a href="#method-i-first">#first</a>
|
90
|
+
|
91
|
+
<li><a href="#method-i-index_key">#index_key</a>
|
92
|
+
|
93
|
+
<li><a href="#method-i-indexed">#indexed</a>
|
94
|
+
|
95
|
+
<li><a href="#method-i-key">#key</a>
|
96
|
+
|
97
|
+
<li><a href="#method-i-last">#last</a>
|
98
|
+
|
99
|
+
<li><a href="#method-i-objects">#objects</a>
|
100
|
+
|
101
|
+
<li><a href="#method-i-push">#push</a>
|
102
|
+
|
103
|
+
<li><a href="#method-i-real_at">#real_at</a>
|
104
|
+
|
105
|
+
<li><a href="#method-i-save">#save</a>
|
106
|
+
|
107
|
+
<li><a href="#method-i-select">#select</a>
|
108
|
+
|
109
|
+
</ul>
|
110
|
+
</nav>
|
111
|
+
|
112
|
+
</div>
|
113
|
+
|
114
|
+
<div id="project-metadata">
|
115
|
+
|
116
|
+
<nav id="classindex-section" class="section project-section">
|
117
|
+
<h3 class="section-header">Class and Module Index</h3>
|
118
|
+
|
119
|
+
<ul class="link-list">
|
120
|
+
|
121
|
+
<li><a href="../Seabright.html">Seabright</a>
|
122
|
+
|
123
|
+
<li><a href="../Seabright/Adapter.html">Seabright::Adapter</a>
|
124
|
+
|
125
|
+
<li><a href="../Seabright/Collection.html">Seabright::Collection</a>
|
126
|
+
|
127
|
+
<li><a href="../Seabright/Collections.html">Seabright::Collections</a>
|
128
|
+
|
129
|
+
<li><a href="../Seabright/Collections/ClassMethods.html">Seabright::Collections::ClassMethods</a>
|
130
|
+
|
131
|
+
<li><a href="../Seabright/ExternalIndex.html">Seabright::ExternalIndex</a>
|
132
|
+
|
133
|
+
<li><a href="../Seabright/History.html">Seabright::History</a>
|
134
|
+
|
135
|
+
<li><a href="../Seabright/History/ClassMethods.html">Seabright::History::ClassMethods</a>
|
136
|
+
|
137
|
+
<li><a href="../Seabright/Indices.html">Seabright::Indices</a>
|
138
|
+
|
139
|
+
<li><a href="../Seabright/Indices/ClassMethods.html">Seabright::Indices::ClassMethods</a>
|
140
|
+
|
141
|
+
<li><a href="../Seabright/Keys.html">Seabright::Keys</a>
|
142
|
+
|
143
|
+
<li><a href="../Seabright/Keys/ClassMethods.html">Seabright::Keys::ClassMethods</a>
|
144
|
+
|
145
|
+
<li><a href="../Seabright/ObjectBase.html">Seabright::ObjectBase</a>
|
146
|
+
|
147
|
+
<li><a href="../Seabright/ObjectBase/ClassMethods.html">Seabright::ObjectBase::ClassMethods</a>
|
148
|
+
|
149
|
+
<li><a href="../Seabright/RedisObject.html">Seabright::RedisObject</a>
|
150
|
+
|
151
|
+
<li><a href="../Seabright/RedisObject.html">Seabright::RedisObject</a>
|
152
|
+
|
153
|
+
<li><a href="../Seabright/References.html">Seabright::References</a>
|
154
|
+
|
155
|
+
<li><a href="../Seabright/Storage.html">Seabright::Storage</a>
|
156
|
+
|
157
|
+
<li><a href="../Seabright/Storage/ClassMethods.html">Seabright::Storage::ClassMethods</a>
|
158
|
+
|
159
|
+
<li><a href="../Seabright/Storage/MySQL.html">Seabright::Storage::MySQL</a>
|
160
|
+
|
161
|
+
<li><a href="../Seabright/Storage/Redis.html">Seabright::Storage::Redis</a>
|
162
|
+
|
163
|
+
<li><a href="../Seabright/Template.html">Seabright::Template</a>
|
164
|
+
|
165
|
+
<li><a href="../Seabright/Template/ClassMethods.html">Seabright::Template::ClassMethods</a>
|
166
|
+
|
167
|
+
<li><a href="../Seabright/Timestamps.html">Seabright::Timestamps</a>
|
168
|
+
|
169
|
+
<li><a href="../Seabright/Timestamps/ClassMethods.html">Seabright::Timestamps::ClassMethods</a>
|
170
|
+
|
171
|
+
<li><a href="../Seabright/Types.html">Seabright::Types</a>
|
172
|
+
|
173
|
+
<li><a href="../Seabright/Types/ClassMethods.html">Seabright::Types::ClassMethods</a>
|
174
|
+
|
175
|
+
<li><a href="../Object.html">Object</a>
|
176
|
+
|
177
|
+
<li><a href="../Seabright/RedisObject.html">Object::RedisObject</a>
|
178
|
+
|
179
|
+
</ul>
|
180
|
+
</nav>
|
181
|
+
|
182
|
+
</div>
|
183
|
+
</nav>
|
184
|
+
|
185
|
+
<div id="documentation">
|
186
|
+
<h1 class="class">class Seabright::Collection</h1>
|
187
|
+
|
188
|
+
<div id="description" class="description">
|
189
|
+
|
190
|
+
</div><!-- description -->
|
191
|
+
|
192
|
+
|
193
|
+
|
194
|
+
|
195
|
+
<section id="5Buntitled-5D" class="documentation-section">
|
196
|
+
|
197
|
+
|
198
|
+
|
199
|
+
|
200
|
+
|
201
|
+
|
202
|
+
|
203
|
+
|
204
|
+
<!-- Methods -->
|
205
|
+
|
206
|
+
<section id="public-class-5Buntitled-5D-method-details" class="method-section section">
|
207
|
+
<h3 class="section-header">Public Class Methods</h3>
|
208
|
+
|
209
|
+
|
210
|
+
<div id="method-c-load" class="method-detail ">
|
211
|
+
|
212
|
+
<div class="method-heading">
|
213
|
+
<span class="method-name">load</span><span
|
214
|
+
class="method-args">(name,parent)</span>
|
215
|
+
<span class="method-click-advice">click to toggle source</span>
|
216
|
+
</div>
|
217
|
+
|
218
|
+
|
219
|
+
<div class="method-description">
|
220
|
+
|
221
|
+
|
222
|
+
|
223
|
+
|
224
|
+
|
225
|
+
<div class="method-source-code" id="load-source">
|
226
|
+
<pre><span class="ruby-comment"># File lib/redis_object/collection.rb, line 192</span>
|
227
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">load</span>(<span class="ruby-identifier">name</span>,<span class="ruby-identifier">parent</span>)
|
228
|
+
<span class="ruby-identifier">out</span> = <span class="ruby-keyword">self</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">name</span>,<span class="ruby-identifier">parent</span>)
|
229
|
+
<span class="ruby-identifier">out</span>.<span class="ruby-identifier">replace</span> <span class="ruby-identifier">store</span>.<span class="ruby-identifier">smembers</span>(<span class="ruby-identifier">out</span>.<span class="ruby-identifier">key</span>)
|
230
|
+
<span class="ruby-identifier">out</span>
|
231
|
+
<span class="ruby-keyword">end</span></pre>
|
232
|
+
</div><!-- load-source -->
|
233
|
+
|
234
|
+
</div>
|
235
|
+
|
236
|
+
|
237
|
+
|
238
|
+
|
239
|
+
</div><!-- load-method -->
|
240
|
+
|
241
|
+
|
242
|
+
<div id="method-c-new" class="method-detail ">
|
243
|
+
|
244
|
+
<div class="method-heading">
|
245
|
+
<span class="method-name">new</span><span
|
246
|
+
class="method-args">(name,parent)</span>
|
247
|
+
<span class="method-click-advice">click to toggle source</span>
|
248
|
+
</div>
|
249
|
+
|
250
|
+
|
251
|
+
<div class="method-description">
|
252
|
+
|
253
|
+
|
254
|
+
|
255
|
+
|
256
|
+
|
257
|
+
<div class="method-source-code" id="new-source">
|
258
|
+
<pre><span class="ruby-comment"># File lib/redis_object/collection.rb, line 99</span>
|
259
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">name</span>,<span class="ruby-identifier">parent</span>)
|
260
|
+
<span class="ruby-ivar">@name</span> = <span class="ruby-identifier">name</span>
|
261
|
+
<span class="ruby-ivar">@parent</span> = <span class="ruby-identifier">parent</span>
|
262
|
+
<span class="ruby-keyword">end</span></pre>
|
263
|
+
</div><!-- new-source -->
|
264
|
+
|
265
|
+
</div>
|
266
|
+
|
267
|
+
|
268
|
+
|
269
|
+
|
270
|
+
</div><!-- new-method -->
|
271
|
+
|
272
|
+
|
273
|
+
</section><!-- public-class-method-details -->
|
274
|
+
|
275
|
+
<section id="public-instance-5Buntitled-5D-method-details" class="method-section section">
|
276
|
+
<h3 class="section-header">Public Instance Methods</h3>
|
277
|
+
|
278
|
+
|
279
|
+
<div id="method-i-3C-3C" class="method-detail ">
|
280
|
+
|
281
|
+
<div class="method-heading">
|
282
|
+
<span class="method-name"><<</span><span
|
283
|
+
class="method-args">(obj)</span>
|
284
|
+
<span class="method-click-advice">click to toggle source</span>
|
285
|
+
</div>
|
286
|
+
|
287
|
+
|
288
|
+
<div class="method-description">
|
289
|
+
|
290
|
+
|
291
|
+
|
292
|
+
|
293
|
+
|
294
|
+
<div class="method-source-code" id="3C-3C-source">
|
295
|
+
<pre><span class="ruby-comment"># File lib/redis_object/collection.rb, line 173</span>
|
296
|
+
<span class="ruby-keyword">def</span> <span class="ruby-operator"><<</span>(<span class="ruby-identifier">obj</span>)
|
297
|
+
<span class="ruby-identifier">store</span>.<span class="ruby-identifier">sadd</span>(<span class="ruby-identifier">key</span>,<span class="ruby-identifier">obj</span>)
|
298
|
+
<span class="ruby-keyword">super</span>(<span class="ruby-identifier">obj</span>)
|
299
|
+
<span class="ruby-keyword">end</span></pre>
|
300
|
+
</div><!-- 3C-3C-source -->
|
301
|
+
|
302
|
+
</div>
|
303
|
+
|
304
|
+
|
305
|
+
<div class="aliases">
|
306
|
+
Also aliased as: <a href="Collection.html#method-i-push">push</a>
|
307
|
+
</div>
|
308
|
+
|
309
|
+
|
310
|
+
|
311
|
+
</div><!-- 3C-3C-method -->
|
312
|
+
|
313
|
+
|
314
|
+
<div id="method-i-5B-5D" class="method-detail ">
|
315
|
+
|
316
|
+
<div class="method-heading">
|
317
|
+
<span class="method-name">[]</span><span
|
318
|
+
class="method-args">(idx)</span>
|
319
|
+
<span class="method-click-advice">click to toggle source</span>
|
320
|
+
</div>
|
321
|
+
|
322
|
+
|
323
|
+
<div class="method-description">
|
324
|
+
|
325
|
+
|
326
|
+
|
327
|
+
|
328
|
+
|
329
|
+
<div class="method-source-code" id="5B-5D-source">
|
330
|
+
<pre><span class="ruby-comment"># File lib/redis_object/collection.rb, line 131</span>
|
331
|
+
<span class="ruby-keyword">def</span> <span class="ruby-operator">[]</span>(<span class="ruby-identifier">idx</span>)
|
332
|
+
<span class="ruby-identifier">class_const</span>.<span class="ruby-identifier">find_by_key</span>(<span class="ruby-identifier">at</span>(<span class="ruby-identifier">idx</span>))
|
333
|
+
<span class="ruby-keyword">end</span></pre>
|
334
|
+
</div><!-- 5B-5D-source -->
|
335
|
+
|
336
|
+
</div>
|
337
|
+
|
338
|
+
|
339
|
+
|
340
|
+
|
341
|
+
</div><!-- 5B-5D-method -->
|
342
|
+
|
343
|
+
|
344
|
+
<div id="method-i-class_const" class="method-detail ">
|
345
|
+
|
346
|
+
<div class="method-heading">
|
347
|
+
<span class="method-name">class_const</span><span
|
348
|
+
class="method-args">()</span>
|
349
|
+
<span class="method-click-advice">click to toggle source</span>
|
350
|
+
</div>
|
351
|
+
|
352
|
+
|
353
|
+
<div class="method-description">
|
354
|
+
|
355
|
+
|
356
|
+
|
357
|
+
|
358
|
+
|
359
|
+
<div class="method-source-code" id="class_const-source">
|
360
|
+
<pre><span class="ruby-comment"># File lib/redis_object/collection.rb, line 182</span>
|
361
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">class_const</span>
|
362
|
+
<span class="ruby-constant">Object</span>.<span class="ruby-identifier">const_get</span>(<span class="ruby-ivar">@name</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">classify</span>.<span class="ruby-identifier">to_sym</span>)
|
363
|
+
<span class="ruby-keyword">end</span></pre>
|
364
|
+
</div><!-- class_const-source -->
|
365
|
+
|
366
|
+
</div>
|
367
|
+
|
368
|
+
|
369
|
+
|
370
|
+
|
371
|
+
</div><!-- class_const-method -->
|
372
|
+
|
373
|
+
|
374
|
+
<div id="method-i-delete" class="method-detail ">
|
375
|
+
|
376
|
+
<div class="method-heading">
|
377
|
+
<span class="method-name">delete</span><span
|
378
|
+
class="method-args">(obj)</span>
|
379
|
+
<span class="method-click-advice">click to toggle source</span>
|
380
|
+
</div>
|
381
|
+
|
382
|
+
|
383
|
+
<div class="method-description">
|
384
|
+
|
385
|
+
|
386
|
+
|
387
|
+
|
388
|
+
|
389
|
+
<div class="method-source-code" id="delete-source">
|
390
|
+
<pre><span class="ruby-comment"># File lib/redis_object/collection.rb, line 168</span>
|
391
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">delete</span>(<span class="ruby-identifier">obj</span>)
|
392
|
+
<span class="ruby-identifier">store</span>.<span class="ruby-identifier">srem</span>(<span class="ruby-identifier">key</span>,<span class="ruby-identifier">obj</span>)
|
393
|
+
<span class="ruby-keyword">super</span>(<span class="ruby-identifier">obj</span>)
|
394
|
+
<span class="ruby-keyword">end</span></pre>
|
395
|
+
</div><!-- delete-source -->
|
396
|
+
|
397
|
+
</div>
|
398
|
+
|
399
|
+
|
400
|
+
|
401
|
+
|
402
|
+
</div><!-- delete-method -->
|
403
|
+
|
404
|
+
|
405
|
+
<div id="method-i-each" class="method-detail ">
|
406
|
+
|
407
|
+
<div class="method-heading">
|
408
|
+
<span class="method-name">each</span><span
|
409
|
+
class="method-args">() { |a| ... }</span>
|
410
|
+
<span class="method-click-advice">click to toggle source</span>
|
411
|
+
</div>
|
412
|
+
|
413
|
+
|
414
|
+
<div class="method-description">
|
415
|
+
|
416
|
+
|
417
|
+
|
418
|
+
|
419
|
+
|
420
|
+
<div class="method-source-code" id="each-source">
|
421
|
+
<pre><span class="ruby-comment"># File lib/redis_object/collection.rb, line 154</span>
|
422
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">each</span>
|
423
|
+
<span class="ruby-identifier">each_index</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">key</span><span class="ruby-operator">|</span>
|
424
|
+
<span class="ruby-identifier">a</span> = <span class="ruby-identifier">class_const</span>.<span class="ruby-identifier">find_by_key</span>(<span class="ruby-identifier">at</span>(<span class="ruby-identifier">key</span>))
|
425
|
+
<span class="ruby-keyword">yield</span> <span class="ruby-identifier">a</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">a</span>
|
426
|
+
<span class="ruby-keyword">end</span>
|
427
|
+
<span class="ruby-keyword">end</span></pre>
|
428
|
+
</div><!-- each-source -->
|
429
|
+
|
430
|
+
</div>
|
431
|
+
|
432
|
+
|
433
|
+
|
434
|
+
|
435
|
+
</div><!-- each-method -->
|
436
|
+
|
437
|
+
|
438
|
+
<div id="method-i-find" class="method-detail ">
|
439
|
+
|
440
|
+
<div class="method-heading">
|
441
|
+
<span class="method-name">find</span><span
|
442
|
+
class="method-args">(key)</span>
|
443
|
+
<span class="method-click-advice">click to toggle source</span>
|
444
|
+
</div>
|
445
|
+
|
446
|
+
|
447
|
+
<div class="method-description">
|
448
|
+
|
449
|
+
|
450
|
+
|
451
|
+
|
452
|
+
|
453
|
+
<div class="method-source-code" id="find-source">
|
454
|
+
<pre><span class="ruby-comment"># File lib/redis_object/collection.rb, line 120</span>
|
455
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">find</span>(<span class="ruby-identifier">key</span>)
|
456
|
+
<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">a</span><span class="ruby-operator">|</span>
|
457
|
+
<span class="ruby-keyword">return</span> <span class="ruby-identifier">a</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">a</span>.<span class="ruby-identifier">id</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">key</span> <span class="ruby-operator">&&</span> <span class="ruby-identifier">include?</span>(<span class="ruby-identifier">a</span>.<span class="ruby-identifier">hkey</span>)
|
458
|
+
<span class="ruby-keyword">end</span>
|
459
|
+
<span class="ruby-keyword">return</span> <span class="ruby-keyword">nil</span>
|
460
|
+
<span class="ruby-keyword">end</span></pre>
|
461
|
+
</div><!-- find-source -->
|
462
|
+
|
463
|
+
</div>
|
464
|
+
|
465
|
+
|
466
|
+
|
467
|
+
|
468
|
+
</div><!-- find-method -->
|
469
|
+
|
470
|
+
|
471
|
+
<div id="method-i-first" class="method-detail ">
|
472
|
+
|
473
|
+
<div class="method-heading">
|
474
|
+
<span class="method-name">first</span><span
|
475
|
+
class="method-args">()</span>
|
476
|
+
<span class="method-click-advice">click to toggle source</span>
|
477
|
+
</div>
|
478
|
+
|
479
|
+
|
480
|
+
<div class="method-description">
|
481
|
+
|
482
|
+
|
483
|
+
|
484
|
+
|
485
|
+
|
486
|
+
<div class="method-source-code" id="first-source">
|
487
|
+
<pre><span class="ruby-comment"># File lib/redis_object/collection.rb, line 144</span>
|
488
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">first</span>
|
489
|
+
<span class="ruby-identifier">key</span> = <span class="ruby-keyword">super</span>
|
490
|
+
<span class="ruby-identifier">class_const</span>.<span class="ruby-identifier">find_by_key</span>(<span class="ruby-identifier">key</span>)
|
491
|
+
<span class="ruby-keyword">end</span></pre>
|
492
|
+
</div><!-- first-source -->
|
493
|
+
|
494
|
+
</div>
|
495
|
+
|
496
|
+
|
497
|
+
|
498
|
+
|
499
|
+
</div><!-- first-method -->
|
500
|
+
|
501
|
+
|
502
|
+
<div id="method-i-index_key" class="method-detail ">
|
503
|
+
|
504
|
+
<div class="method-heading">
|
505
|
+
<span class="method-name">index_key</span><span
|
506
|
+
class="method-args">(index)</span>
|
507
|
+
<span class="method-click-advice">click to toggle source</span>
|
508
|
+
</div>
|
509
|
+
|
510
|
+
|
511
|
+
<div class="method-description">
|
512
|
+
|
513
|
+
|
514
|
+
|
515
|
+
|
516
|
+
|
517
|
+
<div class="method-source-code" id="index_key-source">
|
518
|
+
<pre><span class="ruby-comment"># File lib/redis_object/collection.rb, line 116</span>
|
519
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">index_key</span>(<span class="ruby-identifier">index</span>)
|
520
|
+
<span class="ruby-node">"#{@parent.key}:#{class_const.name.pluralize}::#{index}"</span>
|
521
|
+
<span class="ruby-keyword">end</span></pre>
|
522
|
+
</div><!-- index_key-source -->
|
523
|
+
|
524
|
+
</div>
|
525
|
+
|
526
|
+
|
527
|
+
|
528
|
+
|
529
|
+
</div><!-- index_key-method -->
|
530
|
+
|
531
|
+
|
532
|
+
<div id="method-i-indexed" class="method-detail ">
|
533
|
+
|
534
|
+
<div class="method-heading">
|
535
|
+
<span class="method-name">indexed</span><span
|
536
|
+
class="method-args">(index,num=5,reverse=false)</span>
|
537
|
+
<span class="method-click-advice">click to toggle source</span>
|
538
|
+
</div>
|
539
|
+
|
540
|
+
|
541
|
+
<div class="method-description">
|
542
|
+
|
543
|
+
|
544
|
+
|
545
|
+
|
546
|
+
|
547
|
+
<div class="method-source-code" id="indexed-source">
|
548
|
+
<pre><span class="ruby-comment"># File lib/redis_object/collection.rb, line 104</span>
|
549
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">indexed</span>(<span class="ruby-identifier">index</span>,<span class="ruby-identifier">num</span>=<span class="ruby-value">5</span>,<span class="ruby-identifier">reverse</span>=<span class="ruby-keyword">false</span>)
|
550
|
+
<span class="ruby-identifier">out</span> = []
|
551
|
+
<span class="ruby-identifier">store</span>.<span class="ruby-identifier">send</span>(<span class="ruby-identifier">reverse</span> <span class="ruby-operator">?</span> <span class="ruby-value">:zrevrange</span> <span class="ruby-operator">:</span> <span class="ruby-value">:zrange</span>,<span class="ruby-identifier">index_key</span>(<span class="ruby-identifier">index</span>), <span class="ruby-value">0</span>, <span class="ruby-identifier">num</span>).<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">member</span><span class="ruby-operator">|</span>
|
552
|
+
<span class="ruby-keyword">if</span> <span class="ruby-identifier">a</span> = <span class="ruby-identifier">class_const</span>.<span class="ruby-identifier">find_by_key</span>(<span class="ruby-identifier">member</span>)
|
553
|
+
<span class="ruby-identifier">out</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">a</span>
|
554
|
+
<span class="ruby-keyword">else</span>
|
555
|
+
<span class="ruby-identifier">store</span>.<span class="ruby-identifier">zrem</span>(<span class="ruby-identifier">index_key</span>(<span class="ruby-identifier">index</span>),<span class="ruby-identifier">member</span>)
|
556
|
+
<span class="ruby-keyword">end</span>
|
557
|
+
<span class="ruby-keyword">end</span>
|
558
|
+
<span class="ruby-identifier">out</span>
|
559
|
+
<span class="ruby-keyword">end</span></pre>
|
560
|
+
</div><!-- indexed-source -->
|
561
|
+
|
562
|
+
</div>
|
563
|
+
|
564
|
+
|
565
|
+
|
566
|
+
|
567
|
+
</div><!-- indexed-method -->
|
568
|
+
|
569
|
+
|
570
|
+
<div id="method-i-key" class="method-detail ">
|
571
|
+
|
572
|
+
<div class="method-heading">
|
573
|
+
<span class="method-name">key</span><span
|
574
|
+
class="method-args">()</span>
|
575
|
+
<span class="method-click-advice">click to toggle source</span>
|
576
|
+
</div>
|
577
|
+
|
578
|
+
|
579
|
+
<div class="method-description">
|
580
|
+
|
581
|
+
|
582
|
+
|
583
|
+
|
584
|
+
|
585
|
+
<div class="method-source-code" id="key-source">
|
586
|
+
<pre><span class="ruby-comment"># File lib/redis_object/collection.rb, line 186</span>
|
587
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">key</span>
|
588
|
+
<span class="ruby-node">"#{@parent ? "#{@parent.key}:" : ""}COLLECTION:#{@name}"</span>
|
589
|
+
<span class="ruby-keyword">end</span></pre>
|
590
|
+
</div><!-- key-source -->
|
591
|
+
|
592
|
+
</div>
|
593
|
+
|
594
|
+
|
595
|
+
|
596
|
+
|
597
|
+
</div><!-- key-method -->
|
598
|
+
|
599
|
+
|
600
|
+
<div id="method-i-last" class="method-detail ">
|
601
|
+
|
602
|
+
<div class="method-heading">
|
603
|
+
<span class="method-name">last</span><span
|
604
|
+
class="method-args">()</span>
|
605
|
+
<span class="method-click-advice">click to toggle source</span>
|
606
|
+
</div>
|
607
|
+
|
608
|
+
|
609
|
+
<div class="method-description">
|
610
|
+
|
611
|
+
|
612
|
+
|
613
|
+
|
614
|
+
|
615
|
+
<div class="method-source-code" id="last-source">
|
616
|
+
<pre><span class="ruby-comment"># File lib/redis_object/collection.rb, line 149</span>
|
617
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">last</span>
|
618
|
+
<span class="ruby-identifier">key</span> = <span class="ruby-keyword">super</span>
|
619
|
+
<span class="ruby-identifier">class_const</span>.<span class="ruby-identifier">find_by_key</span>(<span class="ruby-identifier">key</span>)
|
620
|
+
<span class="ruby-keyword">end</span></pre>
|
621
|
+
</div><!-- last-source -->
|
622
|
+
|
623
|
+
</div>
|
624
|
+
|
625
|
+
|
626
|
+
|
627
|
+
|
628
|
+
</div><!-- last-method -->
|
629
|
+
|
630
|
+
|
631
|
+
<div id="method-i-objects" class="method-detail ">
|
632
|
+
|
633
|
+
<div class="method-heading">
|
634
|
+
<span class="method-name">objects</span><span
|
635
|
+
class="method-args">()</span>
|
636
|
+
<span class="method-click-advice">click to toggle source</span>
|
637
|
+
</div>
|
638
|
+
|
639
|
+
|
640
|
+
<div class="method-description">
|
641
|
+
|
642
|
+
|
643
|
+
|
644
|
+
|
645
|
+
|
646
|
+
<div class="method-source-code" id="objects-source">
|
647
|
+
<pre><span class="ruby-comment"># File lib/redis_object/collection.rb, line 135</span>
|
648
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">objects</span>
|
649
|
+
<span class="ruby-identifier">out</span> = []
|
650
|
+
<span class="ruby-identifier">each_index</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">key</span><span class="ruby-operator">|</span>
|
651
|
+
<span class="ruby-identifier">a</span> = <span class="ruby-identifier">class_const</span>.<span class="ruby-identifier">find_by_key</span>(<span class="ruby-identifier">at</span>(<span class="ruby-identifier">key</span>))
|
652
|
+
<span class="ruby-identifier">out</span>.<span class="ruby-identifier">push</span> <span class="ruby-identifier">a</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">a</span>
|
653
|
+
<span class="ruby-keyword">end</span>
|
654
|
+
<span class="ruby-identifier">out</span>
|
655
|
+
<span class="ruby-keyword">end</span></pre>
|
656
|
+
</div><!-- objects-source -->
|
657
|
+
|
658
|
+
</div>
|
659
|
+
|
660
|
+
|
661
|
+
|
662
|
+
|
663
|
+
</div><!-- objects-method -->
|
664
|
+
|
665
|
+
|
666
|
+
<div id="method-i-push" class="method-detail method-alias">
|
667
|
+
|
668
|
+
<div class="method-heading">
|
669
|
+
<span class="method-name">push</span><span
|
670
|
+
class="method-args">(obj)</span>
|
671
|
+
<span class="method-click-advice">click to toggle source</span>
|
672
|
+
</div>
|
673
|
+
|
674
|
+
|
675
|
+
<div class="method-description">
|
676
|
+
|
677
|
+
|
678
|
+
|
679
|
+
|
680
|
+
|
681
|
+
</div>
|
682
|
+
|
683
|
+
|
684
|
+
|
685
|
+
|
686
|
+
<div class="aliases">
|
687
|
+
Alias for: <a href="Collection.html#method-i-3C-3C"><<</a>
|
688
|
+
</div>
|
689
|
+
|
690
|
+
</div><!-- push-method -->
|
691
|
+
|
692
|
+
|
693
|
+
<div id="method-i-real_at" class="method-detail ">
|
694
|
+
|
695
|
+
<div class="method-heading">
|
696
|
+
<span class="method-name">real_at</span><span
|
697
|
+
class="method-args">(key)</span>
|
698
|
+
<span class="method-click-advice">click to toggle source</span>
|
699
|
+
</div>
|
700
|
+
|
701
|
+
|
702
|
+
<div class="method-description">
|
703
|
+
|
704
|
+
|
705
|
+
|
706
|
+
|
707
|
+
|
708
|
+
<div class="method-source-code" id="real_at-source">
|
709
|
+
<pre><span class="ruby-comment"># File lib/redis_object/collection.rb, line 127</span>
|
710
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">real_at</span>(<span class="ruby-identifier">key</span>)
|
711
|
+
<span class="ruby-identifier">class_const</span>.<span class="ruby-identifier">find_by_key</span>(<span class="ruby-identifier">key</span>)
|
712
|
+
<span class="ruby-keyword">end</span></pre>
|
713
|
+
</div><!-- real_at-source -->
|
714
|
+
|
715
|
+
</div>
|
716
|
+
|
717
|
+
|
718
|
+
|
719
|
+
|
720
|
+
</div><!-- real_at-method -->
|
721
|
+
|
722
|
+
|
723
|
+
<div id="method-i-save" class="method-detail ">
|
724
|
+
|
725
|
+
<div class="method-heading">
|
726
|
+
<span class="method-name">save</span><span
|
727
|
+
class="method-args">()</span>
|
728
|
+
<span class="method-click-advice">click to toggle source</span>
|
729
|
+
</div>
|
730
|
+
|
731
|
+
|
732
|
+
<div class="method-description">
|
733
|
+
|
734
|
+
|
735
|
+
|
736
|
+
|
737
|
+
|
738
|
+
<div class="method-source-code" id="save-source">
|
739
|
+
<pre><span class="ruby-comment"># File lib/redis_object/collection.rb, line 179</span>
|
740
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">save</span>
|
741
|
+
<span class="ruby-keyword">end</span></pre>
|
742
|
+
</div><!-- save-source -->
|
743
|
+
|
744
|
+
</div>
|
745
|
+
|
746
|
+
|
747
|
+
|
748
|
+
|
749
|
+
</div><!-- save-method -->
|
750
|
+
|
751
|
+
|
752
|
+
<div id="method-i-select" class="method-detail ">
|
753
|
+
|
754
|
+
<div class="method-heading">
|
755
|
+
<span class="method-name">select</span><span
|
756
|
+
class="method-args">() { |a| ... }</span>
|
757
|
+
<span class="method-click-advice">click to toggle source</span>
|
758
|
+
</div>
|
759
|
+
|
760
|
+
|
761
|
+
<div class="method-description">
|
762
|
+
|
763
|
+
|
764
|
+
|
765
|
+
|
766
|
+
|
767
|
+
<div class="method-source-code" id="select-source">
|
768
|
+
<pre><span class="ruby-comment"># File lib/redis_object/collection.rb, line 161</span>
|
769
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">select</span>(&<span class="ruby-identifier">block</span>)
|
770
|
+
<span class="ruby-identifier">each_index</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">key</span><span class="ruby-operator">|</span>
|
771
|
+
<span class="ruby-identifier">a</span> = <span class="ruby-identifier">class_const</span>.<span class="ruby-identifier">find_by_key</span>(<span class="ruby-identifier">at</span>(<span class="ruby-identifier">key</span>))
|
772
|
+
<span class="ruby-keyword">yield</span> <span class="ruby-identifier">a</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">block</span>.<span class="ruby-identifier">call</span>(<span class="ruby-identifier">a</span>)
|
773
|
+
<span class="ruby-keyword">end</span>
|
774
|
+
<span class="ruby-keyword">end</span></pre>
|
775
|
+
</div><!-- select-source -->
|
776
|
+
|
777
|
+
</div>
|
778
|
+
|
779
|
+
|
780
|
+
|
781
|
+
|
782
|
+
</div><!-- select-method -->
|
783
|
+
|
784
|
+
|
785
|
+
</section><!-- public-instance-method-details -->
|
786
|
+
|
787
|
+
</section><!-- 5Buntitled-5D -->
|
788
|
+
|
789
|
+
</div><!-- documentation -->
|
790
|
+
|
791
|
+
|
792
|
+
<footer id="validator-badges">
|
793
|
+
<p><a href="http://validator.w3.org/check/referer">[Validate]</a>
|
794
|
+
<p>Generated by <a href="https://github.com/rdoc/rdoc">RDoc</a> 3.12.
|
795
|
+
<p>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish Rdoc Generator</a> 3.
|
796
|
+
</footer>
|
797
|
+
|