unicache 0.0.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.
@@ -0,0 +1,142 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4
+ <head>
5
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6
+ <title>
7
+ Exception: UniCache::CallbackError
8
+
9
+ &mdash; Documentation by YARD 0.8.6.1
10
+
11
+ </title>
12
+
13
+ <link rel="stylesheet" href="../css/style.css" type="text/css" charset="utf-8" />
14
+
15
+ <link rel="stylesheet" href="../css/common.css" type="text/css" charset="utf-8" />
16
+
17
+ <script type="text/javascript" charset="utf-8">
18
+ hasFrames = window.top.frames.main ? true : false;
19
+ relpath = '../';
20
+ framesUrl = "../frames.html#!" + escape(window.location.href);
21
+ </script>
22
+
23
+
24
+ <script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
25
+
26
+ <script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
27
+
28
+
29
+ </head>
30
+ <body>
31
+ <div id="header">
32
+ <div id="menu">
33
+
34
+ <a href="../_index.html">Index (C)</a> &raquo;
35
+ <span class='title'><span class='object_link'><a href="../UniCache.html" title="UniCache (class)">UniCache</a></span></span>
36
+ &raquo;
37
+ <span class="title">CallbackError</span>
38
+
39
+
40
+ <div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
41
+ </div>
42
+
43
+ <div id="search">
44
+
45
+ <a class="full_list_link" id="class_list_link"
46
+ href="../class_list.html">
47
+ Class List
48
+ </a>
49
+
50
+ <a class="full_list_link" id="method_list_link"
51
+ href="../method_list.html">
52
+ Method List
53
+ </a>
54
+
55
+ <a class="full_list_link" id="file_list_link"
56
+ href="../file_list.html">
57
+ File List
58
+ </a>
59
+
60
+ </div>
61
+ <div class="clear"></div>
62
+ </div>
63
+
64
+ <iframe id="search_frame"></iframe>
65
+
66
+ <div id="content"><h1>Exception: UniCache::CallbackError
67
+
68
+
69
+
70
+ </h1>
71
+
72
+ <dl class="box">
73
+
74
+ <dt class="r1">Inherits:</dt>
75
+ <dd class="r1">
76
+ <span class="inheritName"><span class='object_link'><a href="Error.html" title="UniCache::Error (class)">Error</a></span></span>
77
+
78
+ <ul class="fullTree">
79
+ <li>Object</li>
80
+
81
+ <li class="next">StandardError</li>
82
+
83
+ <li class="next"><span class='object_link'><a href="Error.html" title="UniCache::Error (class)">Error</a></span></li>
84
+
85
+ <li class="next">UniCache::CallbackError</li>
86
+
87
+ </ul>
88
+ <a href="#" class="inheritanceTree">show all</a>
89
+
90
+ </dd>
91
+
92
+
93
+
94
+
95
+
96
+
97
+
98
+
99
+
100
+ <dt class="r2 last">Defined in:</dt>
101
+ <dd class="r2 last">lib/unicache.rb</dd>
102
+
103
+ </dl>
104
+ <div class="clear"></div>
105
+
106
+ <h2>Overview</h2><div class="docstring">
107
+ <div class="discussion">
108
+
109
+ <p>Callback error.</p>
110
+
111
+
112
+ </div>
113
+ </div>
114
+ <div class="tags">
115
+
116
+
117
+ </div>
118
+
119
+
120
+
121
+
122
+
123
+
124
+
125
+
126
+
127
+
128
+
129
+
130
+
131
+
132
+
133
+ </div>
134
+
135
+ <div id="footer">
136
+ Generated on Tue Dec 31 14:00:42 2013 by
137
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
138
+ 0.8.6.1 (ruby-1.9.3).
139
+ </div>
140
+
141
+ </body>
142
+ </html>
@@ -0,0 +1,138 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4
+ <head>
5
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6
+ <title>
7
+ Exception: UniCache::Error
8
+
9
+ &mdash; Documentation by YARD 0.8.6.1
10
+
11
+ </title>
12
+
13
+ <link rel="stylesheet" href="../css/style.css" type="text/css" charset="utf-8" />
14
+
15
+ <link rel="stylesheet" href="../css/common.css" type="text/css" charset="utf-8" />
16
+
17
+ <script type="text/javascript" charset="utf-8">
18
+ hasFrames = window.top.frames.main ? true : false;
19
+ relpath = '../';
20
+ framesUrl = "../frames.html#!" + escape(window.location.href);
21
+ </script>
22
+
23
+
24
+ <script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
25
+
26
+ <script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
27
+
28
+
29
+ </head>
30
+ <body>
31
+ <div id="header">
32
+ <div id="menu">
33
+
34
+ <a href="../_index.html">Index (E)</a> &raquo;
35
+ <span class='title'><span class='object_link'><a href="../UniCache.html" title="UniCache (class)">UniCache</a></span></span>
36
+ &raquo;
37
+ <span class="title">Error</span>
38
+
39
+
40
+ <div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
41
+ </div>
42
+
43
+ <div id="search">
44
+
45
+ <a class="full_list_link" id="class_list_link"
46
+ href="../class_list.html">
47
+ Class List
48
+ </a>
49
+
50
+ <a class="full_list_link" id="method_list_link"
51
+ href="../method_list.html">
52
+ Method List
53
+ </a>
54
+
55
+ <a class="full_list_link" id="file_list_link"
56
+ href="../file_list.html">
57
+ File List
58
+ </a>
59
+
60
+ </div>
61
+ <div class="clear"></div>
62
+ </div>
63
+
64
+ <iframe id="search_frame"></iframe>
65
+
66
+ <div id="content"><h1>Exception: UniCache::Error
67
+
68
+
69
+
70
+ </h1>
71
+
72
+ <dl class="box">
73
+
74
+ <dt class="r1">Inherits:</dt>
75
+ <dd class="r1">
76
+ <span class="inheritName">StandardError</span>
77
+
78
+ <ul class="fullTree">
79
+ <li>Object</li>
80
+
81
+ <li class="next">StandardError</li>
82
+
83
+ <li class="next">UniCache::Error</li>
84
+
85
+ </ul>
86
+ <a href="#" class="inheritanceTree">show all</a>
87
+
88
+ </dd>
89
+
90
+
91
+
92
+
93
+
94
+
95
+
96
+
97
+
98
+ <dt class="r2 last">Defined in:</dt>
99
+ <dd class="r2 last">lib/unicache.rb</dd>
100
+
101
+ </dl>
102
+ <div class="clear"></div>
103
+
104
+ <h2>Overview</h2><div class="docstring">
105
+ <div class="discussion">
106
+
107
+ <p>Generic UniCache exception.</p>
108
+
109
+
110
+ </div>
111
+ </div>
112
+ <div class="tags">
113
+
114
+
115
+ </div><div id="subclasses">
116
+ <h2>Direct Known Subclasses</h2>
117
+ <p class="children"><span class='object_link'><a href="CallbackError.html" title="UniCache::CallbackError (class)">CallbackError</a></span>, <span class='object_link'><a href="FetchError.html" title="UniCache::FetchError (class)">FetchError</a></span>, <span class='object_link'><a href="RemoveError.html" title="UniCache::RemoveError (class)">RemoveError</a></span>, <span class='object_link'><a href="SizeError.html" title="UniCache::SizeError (class)">SizeError</a></span></p>
118
+ </div>
119
+
120
+
121
+
122
+
123
+
124
+
125
+
126
+
127
+
128
+
129
+ </div>
130
+
131
+ <div id="footer">
132
+ Generated on Tue Dec 31 14:00:42 2013 by
133
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
134
+ 0.8.6.1 (ruby-1.9.3).
135
+ </div>
136
+
137
+ </body>
138
+ </html>
@@ -0,0 +1,142 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4
+ <head>
5
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6
+ <title>
7
+ Exception: UniCache::FetchError
8
+
9
+ &mdash; Documentation by YARD 0.8.6.1
10
+
11
+ </title>
12
+
13
+ <link rel="stylesheet" href="../css/style.css" type="text/css" charset="utf-8" />
14
+
15
+ <link rel="stylesheet" href="../css/common.css" type="text/css" charset="utf-8" />
16
+
17
+ <script type="text/javascript" charset="utf-8">
18
+ hasFrames = window.top.frames.main ? true : false;
19
+ relpath = '../';
20
+ framesUrl = "../frames.html#!" + escape(window.location.href);
21
+ </script>
22
+
23
+
24
+ <script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
25
+
26
+ <script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
27
+
28
+
29
+ </head>
30
+ <body>
31
+ <div id="header">
32
+ <div id="menu">
33
+
34
+ <a href="../_index.html">Index (F)</a> &raquo;
35
+ <span class='title'><span class='object_link'><a href="../UniCache.html" title="UniCache (class)">UniCache</a></span></span>
36
+ &raquo;
37
+ <span class="title">FetchError</span>
38
+
39
+
40
+ <div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
41
+ </div>
42
+
43
+ <div id="search">
44
+
45
+ <a class="full_list_link" id="class_list_link"
46
+ href="../class_list.html">
47
+ Class List
48
+ </a>
49
+
50
+ <a class="full_list_link" id="method_list_link"
51
+ href="../method_list.html">
52
+ Method List
53
+ </a>
54
+
55
+ <a class="full_list_link" id="file_list_link"
56
+ href="../file_list.html">
57
+ File List
58
+ </a>
59
+
60
+ </div>
61
+ <div class="clear"></div>
62
+ </div>
63
+
64
+ <iframe id="search_frame"></iframe>
65
+
66
+ <div id="content"><h1>Exception: UniCache::FetchError
67
+
68
+
69
+
70
+ </h1>
71
+
72
+ <dl class="box">
73
+
74
+ <dt class="r1">Inherits:</dt>
75
+ <dd class="r1">
76
+ <span class="inheritName"><span class='object_link'><a href="Error.html" title="UniCache::Error (class)">Error</a></span></span>
77
+
78
+ <ul class="fullTree">
79
+ <li>Object</li>
80
+
81
+ <li class="next">StandardError</li>
82
+
83
+ <li class="next"><span class='object_link'><a href="Error.html" title="UniCache::Error (class)">Error</a></span></li>
84
+
85
+ <li class="next">UniCache::FetchError</li>
86
+
87
+ </ul>
88
+ <a href="#" class="inheritanceTree">show all</a>
89
+
90
+ </dd>
91
+
92
+
93
+
94
+
95
+
96
+
97
+
98
+
99
+
100
+ <dt class="r2 last">Defined in:</dt>
101
+ <dd class="r2 last">lib/unicache.rb</dd>
102
+
103
+ </dl>
104
+ <div class="clear"></div>
105
+
106
+ <h2>Overview</h2><div class="docstring">
107
+ <div class="discussion">
108
+
109
+ <p>":getdata" callback data fetch exception.</p>
110
+
111
+
112
+ </div>
113
+ </div>
114
+ <div class="tags">
115
+
116
+
117
+ </div>
118
+
119
+
120
+
121
+
122
+
123
+
124
+
125
+
126
+
127
+
128
+
129
+
130
+
131
+
132
+
133
+ </div>
134
+
135
+ <div id="footer">
136
+ Generated on Tue Dec 31 14:00:42 2013 by
137
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
138
+ 0.8.6.1 (ruby-1.9.3).
139
+ </div>
140
+
141
+ </body>
142
+ </html>
@@ -0,0 +1,583 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4
+ <head>
5
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6
+ <title>
7
+ Class: UniCache::LruEviction
8
+
9
+ &mdash; Documentation by YARD 0.8.6.1
10
+
11
+ </title>
12
+
13
+ <link rel="stylesheet" href="../css/style.css" type="text/css" charset="utf-8" />
14
+
15
+ <link rel="stylesheet" href="../css/common.css" type="text/css" charset="utf-8" />
16
+
17
+ <script type="text/javascript" charset="utf-8">
18
+ hasFrames = window.top.frames.main ? true : false;
19
+ relpath = '../';
20
+ framesUrl = "../frames.html#!" + escape(window.location.href);
21
+ </script>
22
+
23
+
24
+ <script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
25
+
26
+ <script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
27
+
28
+
29
+ </head>
30
+ <body>
31
+ <div id="header">
32
+ <div id="menu">
33
+
34
+ <a href="../_index.html">Index (L)</a> &raquo;
35
+ <span class='title'><span class='object_link'><a href="../UniCache.html" title="UniCache (class)">UniCache</a></span></span>
36
+ &raquo;
37
+ <span class="title">LruEviction</span>
38
+
39
+
40
+ <div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
41
+ </div>
42
+
43
+ <div id="search">
44
+
45
+ <a class="full_list_link" id="class_list_link"
46
+ href="../class_list.html">
47
+ Class List
48
+ </a>
49
+
50
+ <a class="full_list_link" id="method_list_link"
51
+ href="../method_list.html">
52
+ Method List
53
+ </a>
54
+
55
+ <a class="full_list_link" id="file_list_link"
56
+ href="../file_list.html">
57
+ File List
58
+ </a>
59
+
60
+ </div>
61
+ <div class="clear"></div>
62
+ </div>
63
+
64
+ <iframe id="search_frame"></iframe>
65
+
66
+ <div id="content"><h1>Class: UniCache::LruEviction
67
+
68
+
69
+
70
+ </h1>
71
+
72
+ <dl class="box">
73
+
74
+ <dt class="r1">Inherits:</dt>
75
+ <dd class="r1">
76
+ <span class="inheritName">Object</span>
77
+
78
+ <ul class="fullTree">
79
+ <li>Object</li>
80
+
81
+ <li class="next">UniCache::LruEviction</li>
82
+
83
+ </ul>
84
+ <a href="#" class="inheritanceTree">show all</a>
85
+
86
+ </dd>
87
+
88
+
89
+
90
+
91
+
92
+
93
+
94
+
95
+
96
+ <dt class="r2 last">Defined in:</dt>
97
+ <dd class="r2 last">lib/unicache.rb</dd>
98
+
99
+ </dl>
100
+ <div class="clear"></div>
101
+
102
+ <h2>Overview</h2><div class="docstring">
103
+ <div class="discussion">
104
+
105
+ <p>LeastRecentlyUsed eviction policy. Mutex should be used to ensure atomicity
106
+ of operations.</p>
107
+
108
+ <p>Eviction policy class should include methods:</p>
109
+ <dl class="rdoc-list"><dt>update</dt>
110
+ <dd>
111
+ <p>Called when key is accessed (get/put).</p>
112
+ </dd><dt>remove</dt>
113
+ <dd>
114
+ <p>Called when key is removed.</p>
115
+ </dd><dt>nextEvict</dt>
116
+ <dd>
117
+ <p>Peek to what is going to be removed next.</p>
118
+ </dd><dt>clear</dt>
119
+ <dd>
120
+ <p>Reset eviction state.</p>
121
+ </dd></dl>
122
+
123
+
124
+ </div>
125
+ </div>
126
+ <div class="tags">
127
+
128
+
129
+ </div>
130
+
131
+
132
+
133
+
134
+
135
+
136
+
137
+ <h2>
138
+ Instance Method Summary
139
+ <small>(<a href="#" class="summary_toggle">collapse</a>)</small>
140
+ </h2>
141
+
142
+ <ul class="summary">
143
+
144
+ <li class="public ">
145
+ <span class="summary_signature">
146
+
147
+ <a href="#clear-instance_method" title="#clear (instance method)">- (Object) <strong>clear</strong> </a>
148
+
149
+
150
+
151
+ </span>
152
+
153
+
154
+
155
+
156
+
157
+
158
+
159
+
160
+
161
+ <span class="summary_desc"><div class='inline'>
162
+ <p>Clear eviction list.</p>
163
+ </div></span>
164
+
165
+ </li>
166
+
167
+
168
+ <li class="public ">
169
+ <span class="summary_signature">
170
+
171
+ <a href="#initialize-instance_method" title="#initialize (instance method)">- (LruEviction) <strong>initialize</strong> </a>
172
+
173
+
174
+
175
+ </span>
176
+
177
+
178
+ <span class="note title constructor">constructor</span>
179
+
180
+
181
+
182
+
183
+
184
+
185
+
186
+
187
+ <span class="summary_desc"><div class='inline'>
188
+ <p>Instantiate.</p>
189
+ </div></span>
190
+
191
+ </li>
192
+
193
+
194
+ <li class="public ">
195
+ <span class="summary_signature">
196
+
197
+ <a href="#nextEvict-instance_method" title="#nextEvict (instance method)">- (Object) <strong>nextEvict</strong> </a>
198
+
199
+
200
+
201
+ </span>
202
+
203
+
204
+
205
+
206
+
207
+
208
+
209
+
210
+
211
+ <span class="summary_desc"><div class='inline'>
212
+ <p>Return the oldest i.e.</p>
213
+ </div></span>
214
+
215
+ </li>
216
+
217
+
218
+ <li class="public ">
219
+ <span class="summary_signature">
220
+
221
+ <a href="#remove-instance_method" title="#remove (instance method)">- (Object) <strong>remove</strong>(key = nil) </a>
222
+
223
+
224
+
225
+ </span>
226
+
227
+
228
+
229
+
230
+
231
+
232
+
233
+
234
+
235
+ <span class="summary_desc"><div class='inline'>
236
+ <p>Remove oldest entry.</p>
237
+ </div></span>
238
+
239
+ </li>
240
+
241
+
242
+ <li class="public ">
243
+ <span class="summary_signature">
244
+
245
+ <a href="#update-instance_method" title="#update (instance method)">- (Object) <strong>update</strong>(key) </a>
246
+
247
+
248
+
249
+ </span>
250
+
251
+
252
+
253
+
254
+
255
+
256
+
257
+
258
+
259
+ <span class="summary_desc"><div class='inline'>
260
+ <p>Keep track of the least recently used keys.</p>
261
+ </div></span>
262
+
263
+ </li>
264
+
265
+
266
+ </ul>
267
+
268
+
269
+ <div id="constructor_details" class="method_details_list">
270
+ <h2>Constructor Details</h2>
271
+
272
+ <div class="method_details first">
273
+ <h3 class="signature first" id="initialize-instance_method">
274
+
275
+ - (<tt><span class='object_link'><a href="" title="UniCache::LruEviction (class)">LruEviction</a></span></tt>) <strong>initialize</strong>
276
+
277
+
278
+
279
+
280
+
281
+ </h3><div class="docstring">
282
+ <div class="discussion">
283
+
284
+ <p>Instantiate.</p>
285
+
286
+
287
+ </div>
288
+ </div>
289
+ <div class="tags">
290
+
291
+
292
+ </div><table class="source_code">
293
+ <tr>
294
+ <td>
295
+ <pre class="lines">
296
+
297
+
298
+ 311
299
+ 312
300
+ 313
301
+ 314</pre>
302
+ </td>
303
+ <td>
304
+ <pre class="code"><span class="info file"># File 'lib/unicache.rb', line 311</span>
305
+
306
+ <span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span>
307
+ <span class='ivar'>@lock</span> <span class='op'>=</span> <span class='const'>Mutex</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
308
+ <span class='id identifier rubyid_clear'>clear</span>
309
+ <span class='kw'>end</span></pre>
310
+ </td>
311
+ </tr>
312
+ </table>
313
+ </div>
314
+
315
+ </div>
316
+
317
+
318
+ <div id="instance_method_details" class="method_details_list">
319
+ <h2>Instance Method Details</h2>
320
+
321
+
322
+ <div class="method_details first">
323
+ <h3 class="signature first" id="clear-instance_method">
324
+
325
+ - (<tt>Object</tt>) <strong>clear</strong>
326
+
327
+
328
+
329
+
330
+
331
+ </h3><div class="docstring">
332
+ <div class="discussion">
333
+
334
+ <p>Clear eviction list.</p>
335
+
336
+
337
+ </div>
338
+ </div>
339
+ <div class="tags">
340
+
341
+
342
+ </div><table class="source_code">
343
+ <tr>
344
+ <td>
345
+ <pre class="lines">
346
+
347
+
348
+ 318
349
+ 319
350
+ 320
351
+ 321
352
+ 322</pre>
353
+ </td>
354
+ <td>
355
+ <pre class="code"><span class="info file"># File 'lib/unicache.rb', line 318</span>
356
+
357
+ <span class='kw'>def</span> <span class='id identifier rubyid_clear'>clear</span>
358
+ <span class='ivar'>@lock</span><span class='period'>.</span><span class='id identifier rubyid_lock'>lock</span>
359
+ <span class='ivar'>@list</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
360
+ <span class='ivar'>@lock</span><span class='period'>.</span><span class='id identifier rubyid_unlock'>unlock</span>
361
+ <span class='kw'>end</span></pre>
362
+ </td>
363
+ </tr>
364
+ </table>
365
+ </div>
366
+
367
+ <div class="method_details ">
368
+ <h3 class="signature " id="nextEvict-instance_method">
369
+
370
+ - (<tt>Object</tt>) <strong>nextEvict</strong>
371
+
372
+
373
+
374
+
375
+
376
+ </h3><div class="docstring">
377
+ <div class="discussion">
378
+
379
+ <p>Return the oldest i.e. next to be evicted.</p>
380
+
381
+
382
+ </div>
383
+ </div>
384
+ <div class="tags">
385
+
386
+
387
+ </div><table class="source_code">
388
+ <tr>
389
+ <td>
390
+ <pre class="lines">
391
+
392
+
393
+ 365
394
+ 366
395
+ 367</pre>
396
+ </td>
397
+ <td>
398
+ <pre class="code"><span class="info file"># File 'lib/unicache.rb', line 365</span>
399
+
400
+ <span class='kw'>def</span> <span class='id identifier rubyid_nextEvict'>nextEvict</span>
401
+ <span class='ivar'>@list</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</span>
402
+ <span class='kw'>end</span></pre>
403
+ </td>
404
+ </tr>
405
+ </table>
406
+ </div>
407
+
408
+ <div class="method_details ">
409
+ <h3 class="signature " id="remove-instance_method">
410
+
411
+ - (<tt>Object</tt>) <strong>remove</strong>(key = nil)
412
+
413
+
414
+
415
+
416
+
417
+ </h3><div class="docstring">
418
+ <div class="discussion">
419
+
420
+ <p>Remove oldest entry.</p>
421
+
422
+
423
+ </div>
424
+ </div>
425
+ <div class="tags">
426
+ <p class="tag_title">Parameters:</p>
427
+ <ul class="param">
428
+
429
+ <li>
430
+
431
+ <span class='name'>key</span>
432
+
433
+
434
+ <span class='type'>(<tt>Object</tt>)</span>
435
+
436
+
437
+ <em class="default">(defaults to: <tt>nil</tt>)</em>
438
+
439
+
440
+ &mdash;
441
+ <div class='inline'>
442
+ <p>If given, remove this entry instead of oldest.</p>
443
+ </div>
444
+
445
+ </li>
446
+
447
+ </ul>
448
+
449
+
450
+ </div><table class="source_code">
451
+ <tr>
452
+ <td>
453
+ <pre class="lines">
454
+
455
+
456
+ 346
457
+ 347
458
+ 348
459
+ 349
460
+ 350
461
+ 351
462
+ 352
463
+ 353
464
+ 354
465
+ 355
466
+ 356
467
+ 357
468
+ 358
469
+ 359
470
+ 360
471
+ 361</pre>
472
+ </td>
473
+ <td>
474
+ <pre class="code"><span class="info file"># File 'lib/unicache.rb', line 346</span>
475
+
476
+ <span class='kw'>def</span> <span class='id identifier rubyid_remove'>remove</span><span class='lparen'>(</span> <span class='id identifier rubyid_key'>key</span> <span class='op'>=</span> <span class='kw'>nil</span> <span class='rparen'>)</span>
477
+ <span class='ivar'>@lock</span><span class='period'>.</span><span class='id identifier rubyid_lock'>lock</span>
478
+
479
+ <span class='id identifier rubyid_res'>res</span> <span class='op'>=</span> <span class='kw'>nil</span>
480
+
481
+ <span class='kw'>if</span> <span class='id identifier rubyid_key'>key</span>
482
+ <span class='ivar'>@list</span><span class='period'>.</span><span class='id identifier rubyid_delete_if'>delete_if</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_i'>i</span><span class='op'>|</span> <span class='id identifier rubyid_i'>i</span> <span class='op'>==</span> <span class='id identifier rubyid_key'>key</span> <span class='kw'>end</span>
483
+ <span class='id identifier rubyid_res'>res</span> <span class='op'>=</span> <span class='id identifier rubyid_key'>key</span>
484
+ <span class='kw'>else</span>
485
+ <span class='id identifier rubyid_res'>res</span> <span class='op'>=</span> <span class='ivar'>@list</span><span class='period'>.</span><span class='id identifier rubyid_shift'>shift</span>
486
+ <span class='kw'>end</span>
487
+
488
+ <span class='ivar'>@lock</span><span class='period'>.</span><span class='id identifier rubyid_unlock'>unlock</span>
489
+
490
+ <span class='id identifier rubyid_res'>res</span>
491
+ <span class='kw'>end</span></pre>
492
+ </td>
493
+ </tr>
494
+ </table>
495
+ </div>
496
+
497
+ <div class="method_details ">
498
+ <h3 class="signature " id="update-instance_method">
499
+
500
+ - (<tt>Object</tt>) <strong>update</strong>(key)
501
+
502
+
503
+
504
+
505
+
506
+ </h3><div class="docstring">
507
+ <div class="discussion">
508
+
509
+ <p>Keep track of the least recently used keys. Place oldest at the beginning
510
+ of the list.</p>
511
+
512
+
513
+ </div>
514
+ </div>
515
+ <div class="tags">
516
+ <p class="tag_title">Parameters:</p>
517
+ <ul class="param">
518
+
519
+ <li>
520
+
521
+ <span class='name'>key</span>
522
+
523
+
524
+ <span class='type'>(<tt>Object</tt>)</span>
525
+
526
+
527
+
528
+ </li>
529
+
530
+ </ul>
531
+
532
+
533
+ </div><table class="source_code">
534
+ <tr>
535
+ <td>
536
+ <pre class="lines">
537
+
538
+
539
+ 329
540
+ 330
541
+ 331
542
+ 332
543
+ 333
544
+ 334
545
+ 335
546
+ 336
547
+ 337
548
+ 338
549
+ 339
550
+ 340</pre>
551
+ </td>
552
+ <td>
553
+ <pre class="code"><span class="info file"># File 'lib/unicache.rb', line 329</span>
554
+
555
+ <span class='kw'>def</span> <span class='id identifier rubyid_update'>update</span><span class='lparen'>(</span> <span class='id identifier rubyid_key'>key</span> <span class='rparen'>)</span>
556
+
557
+ <span class='ivar'>@lock</span><span class='period'>.</span><span class='id identifier rubyid_lock'>lock</span>
558
+
559
+ <span class='comment'># Delete old entries of this key.
560
+ </span> <span class='ivar'>@list</span><span class='period'>.</span><span class='id identifier rubyid_delete_if'>delete_if</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_i'>i</span><span class='op'>|</span> <span class='id identifier rubyid_i'>i</span> <span class='op'>==</span> <span class='id identifier rubyid_key'>key</span> <span class='kw'>end</span>
561
+
562
+ <span class='comment'># Add to end of LRU.
563
+ </span> <span class='ivar'>@list</span><span class='period'>.</span><span class='id identifier rubyid_push'>push</span> <span class='id identifier rubyid_key'>key</span>
564
+
565
+ <span class='ivar'>@lock</span><span class='period'>.</span><span class='id identifier rubyid_unlock'>unlock</span>
566
+ <span class='kw'>end</span></pre>
567
+ </td>
568
+ </tr>
569
+ </table>
570
+ </div>
571
+
572
+ </div>
573
+
574
+ </div>
575
+
576
+ <div id="footer">
577
+ Generated on Tue Dec 31 14:00:42 2013 by
578
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
579
+ 0.8.6.1 (ruby-1.9.3).
580
+ </div>
581
+
582
+ </body>
583
+ </html>