redis_object 1.0 → 1.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.
- data/.coveralls.yml +1 -0
- data/.gitignore +2 -0
- data/.travis.yml +5 -0
- data/Gemfile +4 -0
- data/README.markdown +24 -15
- data/Rakefile +8 -0
- data/lib/redis_object.rb +11 -1
- data/lib/redis_object/base.rb +210 -60
- data/lib/redis_object/collection.rb +130 -100
- data/lib/redis_object/defaults.rb +21 -8
- data/lib/redis_object/{history.rb → experimental/history.rb} +0 -0
- data/lib/redis_object/ext/filters.rb +34 -16
- data/lib/redis_object/ext/script_cache.rb +92 -0
- data/lib/redis_object/ext/shardable.rb +18 -0
- data/lib/redis_object/ext/triggers.rb +75 -13
- data/lib/redis_object/ext/view_caching.rb +258 -0
- data/lib/redis_object/ext/views.rb +102 -0
- data/lib/redis_object/indices.rb +44 -39
- data/lib/redis_object/inheritance_tracking.rb +23 -0
- data/lib/redis_object/keys.rb +4 -4
- data/lib/redis_object/storage.rb +30 -1
- data/lib/redis_object/storage/adapter.rb +6 -3
- data/lib/redis_object/storage/redis.rb +98 -3
- data/lib/redis_object/timestamps.rb +42 -21
- data/lib/redis_object/types.rb +172 -30
- data/lib/redis_object/version.rb +1 -1
- data/redis_object.gemspec +1 -0
- data/spec/adapter_spec.rb +43 -0
- data/spec/base_spec.rb +41 -6
- data/spec/benchmark_spec.rb +46 -0
- data/spec/collections_spec.rb +144 -0
- data/spec/defaults_spec.rb +56 -0
- data/spec/filters_spec.rb +29 -0
- data/spec/indices_spec.rb +45 -0
- data/spec/rename_class_spec.rb +96 -0
- data/spec/spec_helper.rb +32 -1
- data/spec/timestamp_spec.rb +28 -0
- data/spec/trigger_spec.rb +51 -0
- data/spec/types_spec.rb +103 -0
- data/spec/view_caching_spec.rb +130 -0
- data/spec/views_spec.rb +72 -0
- metadata +111 -116
- data/doc/Object.html +0 -185
- data/doc/Seabright.html +0 -181
- data/doc/Seabright/Adapter.html +0 -442
- data/doc/Seabright/Collection.html +0 -797
- data/doc/Seabright/Collections.html +0 -635
- data/doc/Seabright/Collections/ClassMethods.html +0 -212
- data/doc/Seabright/ExternalIndex.html +0 -217
- data/doc/Seabright/History.html +0 -382
- data/doc/Seabright/History/ClassMethods.html +0 -276
- data/doc/Seabright/Indices.html +0 -324
- data/doc/Seabright/Indices/ClassMethods.html +0 -348
- data/doc/Seabright/Keys.html +0 -314
- data/doc/Seabright/Keys/ClassMethods.html +0 -276
- data/doc/Seabright/ObjectBase.html +0 -852
- data/doc/Seabright/ObjectBase/ClassMethods.html +0 -677
- data/doc/Seabright/RedisObject.html +0 -230
- data/doc/Seabright/References.html +0 -280
- data/doc/Seabright/Storage.html +0 -252
- data/doc/Seabright/Storage/ClassMethods.html +0 -276
- data/doc/Seabright/Storage/MySQL.html +0 -442
- data/doc/Seabright/Storage/Redis.html +0 -218
- data/doc/Seabright/Template.html +0 -212
- data/doc/Seabright/Template/ClassMethods.html +0 -166
- data/doc/Seabright/Timestamps.html +0 -292
- data/doc/Seabright/Timestamps/ClassMethods.html +0 -214
- data/doc/Seabright/Types.html +0 -410
- data/doc/Seabright/Types/ClassMethods.html +0 -308
- data/doc/created.rid +0 -17
- 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 +0 -125
- data/doc/js/darkfish.js +0 -153
- data/doc/js/jquery.js +0 -18
- data/doc/js/navigation.js +0 -142
- data/doc/js/search.js +0 -94
- data/doc/js/search_index.js +0 -1
- data/doc/js/searcher.js +0 -228
- data/doc/rdoc.css +0 -543
- data/doc/table_of_contents.html +0 -394
@@ -1,635 +0,0 @@
|
|
1
|
-
<!DOCTYPE html>
|
2
|
-
|
3
|
-
<html>
|
4
|
-
<head>
|
5
|
-
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
|
6
|
-
|
7
|
-
<title>module Seabright::Collections - 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="module">
|
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
|
-
|
60
|
-
|
61
|
-
<!-- Method Quickref -->
|
62
|
-
<nav id="method-list-section" class="section">
|
63
|
-
<h3 class="section-header">Methods</h3>
|
64
|
-
|
65
|
-
<ul class="link-list">
|
66
|
-
|
67
|
-
<li><a href="#method-c-included">::included</a>
|
68
|
-
|
69
|
-
<li><a href="#method-c-new">::new</a>
|
70
|
-
|
71
|
-
<li><a href="#method-i-3C-3C">#<<</a>
|
72
|
-
|
73
|
-
<li><a href="#method-i-delete_child">#delete_child</a>
|
74
|
-
|
75
|
-
<li><a href="#method-i-dump">#dump</a>
|
76
|
-
|
77
|
-
<li><a href="#method-i-get">#get</a>
|
78
|
-
|
79
|
-
<li><a href="#method-i-get_collection">#get_collection</a>
|
80
|
-
|
81
|
-
<li><a href="#method-i-has_collection-3F">#has_collection?</a>
|
82
|
-
|
83
|
-
<li><a href="#method-i-hkey_col">#hkey_col</a>
|
84
|
-
|
85
|
-
<li><a href="#method-i-load">#load</a>
|
86
|
-
|
87
|
-
<li><a href="#method-i-push">#push</a>
|
88
|
-
|
89
|
-
<li><a href="#method-i-save">#save</a>
|
90
|
-
|
91
|
-
<li><a href="#method-i-set">#set</a>
|
92
|
-
|
93
|
-
</ul>
|
94
|
-
</nav>
|
95
|
-
|
96
|
-
</div>
|
97
|
-
|
98
|
-
<div id="project-metadata">
|
99
|
-
|
100
|
-
<nav id="classindex-section" class="section project-section">
|
101
|
-
<h3 class="section-header">Class and Module Index</h3>
|
102
|
-
|
103
|
-
<ul class="link-list">
|
104
|
-
|
105
|
-
<li><a href="../Seabright.html">Seabright</a>
|
106
|
-
|
107
|
-
<li><a href="../Seabright/Adapter.html">Seabright::Adapter</a>
|
108
|
-
|
109
|
-
<li><a href="../Seabright/Collection.html">Seabright::Collection</a>
|
110
|
-
|
111
|
-
<li><a href="../Seabright/Collections.html">Seabright::Collections</a>
|
112
|
-
|
113
|
-
<li><a href="../Seabright/Collections/ClassMethods.html">Seabright::Collections::ClassMethods</a>
|
114
|
-
|
115
|
-
<li><a href="../Seabright/ExternalIndex.html">Seabright::ExternalIndex</a>
|
116
|
-
|
117
|
-
<li><a href="../Seabright/History.html">Seabright::History</a>
|
118
|
-
|
119
|
-
<li><a href="../Seabright/History/ClassMethods.html">Seabright::History::ClassMethods</a>
|
120
|
-
|
121
|
-
<li><a href="../Seabright/Indices.html">Seabright::Indices</a>
|
122
|
-
|
123
|
-
<li><a href="../Seabright/Indices/ClassMethods.html">Seabright::Indices::ClassMethods</a>
|
124
|
-
|
125
|
-
<li><a href="../Seabright/Keys.html">Seabright::Keys</a>
|
126
|
-
|
127
|
-
<li><a href="../Seabright/Keys/ClassMethods.html">Seabright::Keys::ClassMethods</a>
|
128
|
-
|
129
|
-
<li><a href="../Seabright/ObjectBase.html">Seabright::ObjectBase</a>
|
130
|
-
|
131
|
-
<li><a href="../Seabright/ObjectBase/ClassMethods.html">Seabright::ObjectBase::ClassMethods</a>
|
132
|
-
|
133
|
-
<li><a href="../Seabright/RedisObject.html">Seabright::RedisObject</a>
|
134
|
-
|
135
|
-
<li><a href="../Seabright/RedisObject.html">Seabright::RedisObject</a>
|
136
|
-
|
137
|
-
<li><a href="../Seabright/References.html">Seabright::References</a>
|
138
|
-
|
139
|
-
<li><a href="../Seabright/Storage.html">Seabright::Storage</a>
|
140
|
-
|
141
|
-
<li><a href="../Seabright/Storage/ClassMethods.html">Seabright::Storage::ClassMethods</a>
|
142
|
-
|
143
|
-
<li><a href="../Seabright/Storage/MySQL.html">Seabright::Storage::MySQL</a>
|
144
|
-
|
145
|
-
<li><a href="../Seabright/Storage/Redis.html">Seabright::Storage::Redis</a>
|
146
|
-
|
147
|
-
<li><a href="../Seabright/Template.html">Seabright::Template</a>
|
148
|
-
|
149
|
-
<li><a href="../Seabright/Template/ClassMethods.html">Seabright::Template::ClassMethods</a>
|
150
|
-
|
151
|
-
<li><a href="../Seabright/Timestamps.html">Seabright::Timestamps</a>
|
152
|
-
|
153
|
-
<li><a href="../Seabright/Timestamps/ClassMethods.html">Seabright::Timestamps::ClassMethods</a>
|
154
|
-
|
155
|
-
<li><a href="../Seabright/Types.html">Seabright::Types</a>
|
156
|
-
|
157
|
-
<li><a href="../Seabright/Types/ClassMethods.html">Seabright::Types::ClassMethods</a>
|
158
|
-
|
159
|
-
<li><a href="../Object.html">Object</a>
|
160
|
-
|
161
|
-
<li><a href="../Seabright/RedisObject.html">Object::RedisObject</a>
|
162
|
-
|
163
|
-
</ul>
|
164
|
-
</nav>
|
165
|
-
|
166
|
-
</div>
|
167
|
-
</nav>
|
168
|
-
|
169
|
-
<div id="documentation">
|
170
|
-
<h1 class="module">module Seabright::Collections</h1>
|
171
|
-
|
172
|
-
<div id="description" class="description">
|
173
|
-
|
174
|
-
</div><!-- description -->
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
<section id="5Buntitled-5D" class="documentation-section">
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
<!-- Methods -->
|
189
|
-
|
190
|
-
<section id="public-class-5Buntitled-5D-method-details" class="method-section section">
|
191
|
-
<h3 class="section-header">Public Class Methods</h3>
|
192
|
-
|
193
|
-
|
194
|
-
<div id="method-c-included" class="method-detail ">
|
195
|
-
|
196
|
-
<div class="method-heading">
|
197
|
-
<span class="method-name">included</span><span
|
198
|
-
class="method-args">(base)</span>
|
199
|
-
<span class="method-click-advice">click to toggle source</span>
|
200
|
-
</div>
|
201
|
-
|
202
|
-
|
203
|
-
<div class="method-description">
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
<div class="method-source-code" id="included-source">
|
210
|
-
<pre><span class="ruby-comment"># File lib/redis_object/collection.rb, line 90</span>
|
211
|
-
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">included</span>(<span class="ruby-identifier">base</span>)
|
212
|
-
<span class="ruby-identifier">base</span>.<span class="ruby-identifier">extend</span>(<span class="ruby-constant">ClassMethods</span>)
|
213
|
-
<span class="ruby-keyword">end</span></pre>
|
214
|
-
</div><!-- included-source -->
|
215
|
-
|
216
|
-
</div>
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
</div><!-- included-method -->
|
222
|
-
|
223
|
-
|
224
|
-
<div id="method-c-new" class="method-detail ">
|
225
|
-
|
226
|
-
<div class="method-heading">
|
227
|
-
<span class="method-name">new</span><span
|
228
|
-
class="method-args">(*args)</span>
|
229
|
-
<span class="method-click-advice">click to toggle source</span>
|
230
|
-
</div>
|
231
|
-
|
232
|
-
|
233
|
-
<div class="method-description">
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
<div class="method-source-code" id="new-source">
|
240
|
-
<pre><span class="ruby-comment"># File lib/redis_object/collection.rb, line 5</span>
|
241
|
-
<span class="ruby-keyword">def</span> <span class="ruby-identifier">initialize</span>(*<span class="ruby-identifier">args</span>)
|
242
|
-
<span class="ruby-ivar">@collections</span> = {}
|
243
|
-
<span class="ruby-keyword">super</span>(*<span class="ruby-identifier">args</span>)
|
244
|
-
<span class="ruby-keyword">end</span></pre>
|
245
|
-
</div><!-- new-source -->
|
246
|
-
|
247
|
-
</div>
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
</div><!-- new-method -->
|
253
|
-
|
254
|
-
|
255
|
-
</section><!-- public-class-method-details -->
|
256
|
-
|
257
|
-
<section id="public-instance-5Buntitled-5D-method-details" class="method-section section">
|
258
|
-
<h3 class="section-header">Public Instance Methods</h3>
|
259
|
-
|
260
|
-
|
261
|
-
<div id="method-i-3C-3C" class="method-detail ">
|
262
|
-
|
263
|
-
<div class="method-heading">
|
264
|
-
<span class="method-name"><<</span><span
|
265
|
-
class="method-args">(obj)</span>
|
266
|
-
<span class="method-click-advice">click to toggle source</span>
|
267
|
-
</div>
|
268
|
-
|
269
|
-
|
270
|
-
<div class="method-description">
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
<div class="method-source-code" id="3C-3C-source">
|
277
|
-
<pre><span class="ruby-comment"># File lib/redis_object/collection.rb, line 50</span>
|
278
|
-
<span class="ruby-keyword">def</span> <span class="ruby-operator"><<</span>(<span class="ruby-identifier">obj</span>)
|
279
|
-
<span class="ruby-identifier">obj</span>.<span class="ruby-identifier">parent</span> = <span class="ruby-keyword">self</span>
|
280
|
-
<span class="ruby-identifier">obj</span>.<span class="ruby-identifier">save</span>
|
281
|
-
<span class="ruby-identifier">name</span> = <span class="ruby-identifier">obj</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">plname</span>.<span class="ruby-identifier">downcase</span>.<span class="ruby-identifier">to_sym</span>
|
282
|
-
<span class="ruby-identifier">store</span>.<span class="ruby-identifier">sadd</span> <span class="ruby-identifier">hkey_col</span>, <span class="ruby-identifier">name</span>
|
283
|
-
<span class="ruby-ivar">@collections</span>[<span class="ruby-identifier">name</span>] <span class="ruby-operator">||=</span> <span class="ruby-constant">Seabright</span><span class="ruby-operator">::</span><span class="ruby-constant">Collection</span>.<span class="ruby-identifier">load</span>(<span class="ruby-identifier">name</span>,<span class="ruby-keyword">self</span>)
|
284
|
-
<span class="ruby-ivar">@collections</span>[<span class="ruby-identifier">name</span>] <span class="ruby-operator"><<</span> <span class="ruby-identifier">obj</span>.<span class="ruby-identifier">hkey</span>
|
285
|
-
<span class="ruby-keyword">end</span></pre>
|
286
|
-
</div><!-- 3C-3C-source -->
|
287
|
-
|
288
|
-
</div>
|
289
|
-
|
290
|
-
|
291
|
-
<div class="aliases">
|
292
|
-
Also aliased as: <a href="Collections.html#method-i-push">push</a>
|
293
|
-
</div>
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
</div><!-- 3C-3C-method -->
|
298
|
-
|
299
|
-
|
300
|
-
<div id="method-i-delete_child" class="method-detail ">
|
301
|
-
|
302
|
-
<div class="method-heading">
|
303
|
-
<span class="method-name">delete_child</span><span
|
304
|
-
class="method-args">(obj)</span>
|
305
|
-
<span class="method-click-advice">click to toggle source</span>
|
306
|
-
</div>
|
307
|
-
|
308
|
-
|
309
|
-
<div class="method-description">
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
<div class="method-source-code" id="delete_child-source">
|
316
|
-
<pre><span class="ruby-comment"># File lib/redis_object/collection.rb, line 44</span>
|
317
|
-
<span class="ruby-keyword">def</span> <span class="ruby-identifier">delete_child</span>(<span class="ruby-identifier">obj</span>)
|
318
|
-
<span class="ruby-keyword">if</span> <span class="ruby-identifier">col</span> = <span class="ruby-ivar">@collections</span>[<span class="ruby-identifier">obj</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">plname</span>.<span class="ruby-identifier">downcase</span>.<span class="ruby-identifier">to_sym</span>]
|
319
|
-
<span class="ruby-identifier">col</span>.<span class="ruby-identifier">delete</span> <span class="ruby-identifier">obj</span>.<span class="ruby-identifier">hkey</span>
|
320
|
-
<span class="ruby-keyword">end</span>
|
321
|
-
<span class="ruby-keyword">end</span></pre>
|
322
|
-
</div><!-- delete_child-source -->
|
323
|
-
|
324
|
-
</div>
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
</div><!-- delete_child-method -->
|
330
|
-
|
331
|
-
|
332
|
-
<div id="method-i-dump" class="method-detail ">
|
333
|
-
|
334
|
-
<div class="method-heading">
|
335
|
-
<span class="method-name">dump</span><span
|
336
|
-
class="method-args">(prnt=nil)</span>
|
337
|
-
<span class="method-click-advice">click to toggle source</span>
|
338
|
-
</div>
|
339
|
-
|
340
|
-
|
341
|
-
<div class="method-description">
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
<div class="method-source-code" id="dump-source">
|
348
|
-
<pre><span class="ruby-comment"># File lib/redis_object/collection.rb, line 10</span>
|
349
|
-
<span class="ruby-keyword">def</span> <span class="ruby-identifier">dump</span>(<span class="ruby-identifier">prnt</span>=<span class="ruby-keyword">nil</span>)
|
350
|
-
<span class="ruby-identifier">require</span> <span class="ruby-string">"utf8_utils"</span>
|
351
|
-
<span class="ruby-identifier">out</span> = [<span class="ruby-node">"puts \"Creating: #{id}\""</span>]
|
352
|
-
<span class="ruby-identifier">s_id</span> = (<span class="ruby-identifier">prnt</span> <span class="ruby-operator">?</span> <span class="ruby-node">"#{prnt.id} #{id}"</span> <span class="ruby-operator">:</span> <span class="ruby-identifier">id</span>).<span class="ruby-identifier">gsub</span>(<span class="ruby-regexp">%r\W/</span>,<span class="ruby-string">"_"</span>)
|
353
|
-
<span class="ruby-identifier">out</span> <span class="ruby-operator"><<</span> <span class="ruby-node">"a#{s_id} = #{self.class.cname}.new(#{actual.to_s.tidy_bytes},#{prnt.id})"</span>
|
354
|
-
<span class="ruby-ivar">@collections</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">col</span><span class="ruby-operator">|</span>
|
355
|
-
<span class="ruby-identifier">col</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">sobj</span><span class="ruby-operator">|</span>
|
356
|
-
<span class="ruby-identifier">out</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">sobj</span>.<span class="ruby-identifier">dump</span>(<span class="ruby-keyword">self</span>)
|
357
|
-
<span class="ruby-keyword">end</span>
|
358
|
-
<span class="ruby-keyword">end</span>
|
359
|
-
<span class="ruby-identifier">out</span> <span class="ruby-operator"><<</span> <span class="ruby-node">"a#{prnt.id.gsub(/\W/,"_")} << a#{s_id}"</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">prnt</span>
|
360
|
-
<span class="ruby-identifier">out</span> <span class="ruby-operator"><<</span> <span class="ruby-node">"a#{s_id}.save"</span>
|
361
|
-
<span class="ruby-identifier">out</span>.<span class="ruby-identifier">join</span>(<span class="ruby-string">"\n"</span>)
|
362
|
-
<span class="ruby-keyword">end</span></pre>
|
363
|
-
</div><!-- dump-source -->
|
364
|
-
|
365
|
-
</div>
|
366
|
-
|
367
|
-
|
368
|
-
|
369
|
-
|
370
|
-
</div><!-- dump-method -->
|
371
|
-
|
372
|
-
|
373
|
-
<div id="method-i-get" class="method-detail ">
|
374
|
-
|
375
|
-
<div class="method-heading">
|
376
|
-
<span class="method-name">get</span><span
|
377
|
-
class="method-args">(k)</span>
|
378
|
-
<span class="method-click-advice">click to toggle source</span>
|
379
|
-
</div>
|
380
|
-
|
381
|
-
|
382
|
-
<div class="method-description">
|
383
|
-
|
384
|
-
|
385
|
-
|
386
|
-
|
387
|
-
|
388
|
-
<div class="method-source-code" id="get-source">
|
389
|
-
<pre><span class="ruby-comment"># File lib/redis_object/collection.rb, line 60</span>
|
390
|
-
<span class="ruby-keyword">def</span> <span class="ruby-identifier">get</span>(<span class="ruby-identifier">k</span>)
|
391
|
-
<span class="ruby-keyword">if</span> <span class="ruby-ivar">@collections</span>[<span class="ruby-identifier">k</span>.<span class="ruby-identifier">to_s</span>]
|
392
|
-
<span class="ruby-identifier">get_collection</span>(<span class="ruby-identifier">k</span>.<span class="ruby-identifier">to_s</span>)
|
393
|
-
<span class="ruby-keyword">else</span>
|
394
|
-
<span class="ruby-keyword">super</span>(<span class="ruby-identifier">k</span>)
|
395
|
-
<span class="ruby-keyword">end</span>
|
396
|
-
<span class="ruby-keyword">end</span></pre>
|
397
|
-
</div><!-- get-source -->
|
398
|
-
|
399
|
-
</div>
|
400
|
-
|
401
|
-
|
402
|
-
|
403
|
-
|
404
|
-
</div><!-- get-method -->
|
405
|
-
|
406
|
-
|
407
|
-
<div id="method-i-get_collection" class="method-detail ">
|
408
|
-
|
409
|
-
<div class="method-heading">
|
410
|
-
<span class="method-name">get_collection</span><span
|
411
|
-
class="method-args">(name)</span>
|
412
|
-
<span class="method-click-advice">click to toggle source</span>
|
413
|
-
</div>
|
414
|
-
|
415
|
-
|
416
|
-
<div class="method-description">
|
417
|
-
|
418
|
-
|
419
|
-
|
420
|
-
|
421
|
-
|
422
|
-
<div class="method-source-code" id="get_collection-source">
|
423
|
-
<pre><span class="ruby-comment"># File lib/redis_object/collection.rb, line 72</span>
|
424
|
-
<span class="ruby-keyword">def</span> <span class="ruby-identifier">get_collection</span>(<span class="ruby-identifier">name</span>)
|
425
|
-
<span class="ruby-ivar">@collections</span>[<span class="ruby-identifier">name</span>.<span class="ruby-identifier">to_s</span>] <span class="ruby-operator">||=</span> <span class="ruby-constant">Collection</span>.<span class="ruby-identifier">load</span>(<span class="ruby-identifier">name</span>,<span class="ruby-keyword">self</span>)
|
426
|
-
<span class="ruby-ivar">@collections</span>[<span class="ruby-identifier">name</span>.<span class="ruby-identifier">to_s</span>]
|
427
|
-
<span class="ruby-keyword">end</span></pre>
|
428
|
-
</div><!-- get_collection-source -->
|
429
|
-
|
430
|
-
</div>
|
431
|
-
|
432
|
-
|
433
|
-
|
434
|
-
|
435
|
-
</div><!-- get_collection-method -->
|
436
|
-
|
437
|
-
|
438
|
-
<div id="method-i-has_collection-3F" class="method-detail ">
|
439
|
-
|
440
|
-
<div class="method-heading">
|
441
|
-
<span class="method-name">has_collection?</span><span
|
442
|
-
class="method-args">(name)</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="has_collection-3F-source">
|
454
|
-
<pre><span class="ruby-comment"># File lib/redis_object/collection.rb, line 68</span>
|
455
|
-
<span class="ruby-keyword">def</span> <span class="ruby-identifier">has_collection?</span>(<span class="ruby-identifier">name</span>)
|
456
|
-
<span class="ruby-operator">!</span><span class="ruby-operator">!</span><span class="ruby-ivar">@collections</span>[<span class="ruby-identifier">name</span>.<span class="ruby-identifier">to_s</span>]
|
457
|
-
<span class="ruby-keyword">end</span></pre>
|
458
|
-
</div><!-- has_collection-3F-source -->
|
459
|
-
|
460
|
-
</div>
|
461
|
-
|
462
|
-
|
463
|
-
|
464
|
-
|
465
|
-
</div><!-- has_collection-3F-method -->
|
466
|
-
|
467
|
-
|
468
|
-
<div id="method-i-hkey_col" class="method-detail ">
|
469
|
-
|
470
|
-
<div class="method-heading">
|
471
|
-
<span class="method-name">hkey_col</span><span
|
472
|
-
class="method-args">(ident = nil, prnt = nil)</span>
|
473
|
-
<span class="method-click-advice">click to toggle source</span>
|
474
|
-
</div>
|
475
|
-
|
476
|
-
|
477
|
-
<div class="method-description">
|
478
|
-
|
479
|
-
|
480
|
-
|
481
|
-
|
482
|
-
|
483
|
-
<div class="method-source-code" id="hkey_col-source">
|
484
|
-
<pre><span class="ruby-comment"># File lib/redis_object/collection.rb, line 25</span>
|
485
|
-
<span class="ruby-keyword">def</span> <span class="ruby-identifier">hkey_col</span>(<span class="ruby-identifier">ident</span> = <span class="ruby-keyword">nil</span>, <span class="ruby-identifier">prnt</span> = <span class="ruby-keyword">nil</span>)
|
486
|
-
<span class="ruby-node">"#{hkey}:collections"</span>
|
487
|
-
<span class="ruby-keyword">end</span></pre>
|
488
|
-
</div><!-- hkey_col-source -->
|
489
|
-
|
490
|
-
</div>
|
491
|
-
|
492
|
-
|
493
|
-
|
494
|
-
|
495
|
-
</div><!-- hkey_col-method -->
|
496
|
-
|
497
|
-
|
498
|
-
<div id="method-i-load" class="method-detail ">
|
499
|
-
|
500
|
-
<div class="method-heading">
|
501
|
-
<span class="method-name">load</span><span
|
502
|
-
class="method-args">(o_id)</span>
|
503
|
-
<span class="method-click-advice">click to toggle source</span>
|
504
|
-
</div>
|
505
|
-
|
506
|
-
|
507
|
-
<div class="method-description">
|
508
|
-
|
509
|
-
|
510
|
-
|
511
|
-
|
512
|
-
|
513
|
-
<div class="method-source-code" id="load-source">
|
514
|
-
<pre><span class="ruby-comment"># File lib/redis_object/collection.rb, line 29</span>
|
515
|
-
<span class="ruby-keyword">def</span> <span class="ruby-identifier">load</span>(<span class="ruby-identifier">o_id</span>)
|
516
|
-
<span class="ruby-keyword">super</span>(<span class="ruby-identifier">o_id</span>)
|
517
|
-
<span class="ruby-identifier">store</span>.<span class="ruby-identifier">smembers</span>(<span class="ruby-identifier">hkey_col</span>).<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">name</span><span class="ruby-operator">|</span>
|
518
|
-
<span class="ruby-ivar">@collections</span>[<span class="ruby-identifier">name</span>] = <span class="ruby-constant">Seabright</span><span class="ruby-operator">::</span><span class="ruby-constant">Collection</span>.<span class="ruby-identifier">load</span>(<span class="ruby-identifier">name</span>,<span class="ruby-keyword">self</span>)
|
519
|
-
<span class="ruby-keyword">end</span>
|
520
|
-
<span class="ruby-keyword">true</span>
|
521
|
-
<span class="ruby-keyword">end</span></pre>
|
522
|
-
</div><!-- load-source -->
|
523
|
-
|
524
|
-
</div>
|
525
|
-
|
526
|
-
|
527
|
-
|
528
|
-
|
529
|
-
</div><!-- load-method -->
|
530
|
-
|
531
|
-
|
532
|
-
<div id="method-i-push" class="method-detail method-alias">
|
533
|
-
|
534
|
-
<div class="method-heading">
|
535
|
-
<span class="method-name">push</span><span
|
536
|
-
class="method-args">(obj)</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>
|
548
|
-
|
549
|
-
|
550
|
-
|
551
|
-
|
552
|
-
<div class="aliases">
|
553
|
-
Alias for: <a href="Collections.html#method-i-3C-3C"><<</a>
|
554
|
-
</div>
|
555
|
-
|
556
|
-
</div><!-- push-method -->
|
557
|
-
|
558
|
-
|
559
|
-
<div id="method-i-save" class="method-detail ">
|
560
|
-
|
561
|
-
<div class="method-heading">
|
562
|
-
<span class="method-name">save</span><span
|
563
|
-
class="method-args">()</span>
|
564
|
-
<span class="method-click-advice">click to toggle source</span>
|
565
|
-
</div>
|
566
|
-
|
567
|
-
|
568
|
-
<div class="method-description">
|
569
|
-
|
570
|
-
|
571
|
-
|
572
|
-
|
573
|
-
|
574
|
-
<div class="method-source-code" id="save-source">
|
575
|
-
<pre><span class="ruby-comment"># File lib/redis_object/collection.rb, line 37</span>
|
576
|
-
<span class="ruby-keyword">def</span> <span class="ruby-identifier">save</span>
|
577
|
-
<span class="ruby-keyword">super</span>
|
578
|
-
<span class="ruby-ivar">@collections</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">k</span>,<span class="ruby-identifier">col</span><span class="ruby-operator">|</span>
|
579
|
-
<span class="ruby-identifier">col</span>.<span class="ruby-identifier">save</span>
|
580
|
-
<span class="ruby-keyword">end</span>
|
581
|
-
<span class="ruby-keyword">end</span></pre>
|
582
|
-
</div><!-- save-source -->
|
583
|
-
|
584
|
-
</div>
|
585
|
-
|
586
|
-
|
587
|
-
|
588
|
-
|
589
|
-
</div><!-- save-method -->
|
590
|
-
|
591
|
-
|
592
|
-
<div id="method-i-set" class="method-detail ">
|
593
|
-
|
594
|
-
<div class="method-heading">
|
595
|
-
<span class="method-name">set</span><span
|
596
|
-
class="method-args">(k,v)</span>
|
597
|
-
<span class="method-click-advice">click to toggle source</span>
|
598
|
-
</div>
|
599
|
-
|
600
|
-
|
601
|
-
<div class="method-description">
|
602
|
-
|
603
|
-
|
604
|
-
|
605
|
-
|
606
|
-
|
607
|
-
<div class="method-source-code" id="set-source">
|
608
|
-
<pre><span class="ruby-comment"># File lib/redis_object/collection.rb, line 77</span>
|
609
|
-
<span class="ruby-keyword">def</span> <span class="ruby-identifier">set</span>(<span class="ruby-identifier">k</span>,<span class="ruby-identifier">v</span>)
|
610
|
-
<span class="ruby-ivar">@data</span> <span class="ruby-operator">?</span> <span class="ruby-keyword">super</span>(<span class="ruby-identifier">k</span>,<span class="ruby-identifier">v</span>) <span class="ruby-operator">:</span> <span class="ruby-ivar">@collections</span>[<span class="ruby-identifier">k</span>.<span class="ruby-identifier">to_sym</span>] <span class="ruby-operator">?</span> <span class="ruby-identifier">get_collection</span>(<span class="ruby-identifier">k</span>).<span class="ruby-identifier">replace</span>(<span class="ruby-identifier">v</span>) <span class="ruby-operator">:</span> <span class="ruby-keyword">super</span>(<span class="ruby-identifier">k</span>,<span class="ruby-identifier">v</span>)
|
611
|
-
<span class="ruby-identifier">v</span>
|
612
|
-
<span class="ruby-keyword">end</span></pre>
|
613
|
-
</div><!-- set-source -->
|
614
|
-
|
615
|
-
</div>
|
616
|
-
|
617
|
-
|
618
|
-
|
619
|
-
|
620
|
-
</div><!-- set-method -->
|
621
|
-
|
622
|
-
|
623
|
-
</section><!-- public-instance-method-details -->
|
624
|
-
|
625
|
-
</section><!-- 5Buntitled-5D -->
|
626
|
-
|
627
|
-
</div><!-- documentation -->
|
628
|
-
|
629
|
-
|
630
|
-
<footer id="validator-badges">
|
631
|
-
<p><a href="http://validator.w3.org/check/referer">[Validate]</a>
|
632
|
-
<p>Generated by <a href="https://github.com/rdoc/rdoc">RDoc</a> 3.12.
|
633
|
-
<p>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish Rdoc Generator</a> 3.
|
634
|
-
</footer>
|
635
|
-
|