cachetastic 2.1.3 → 2.1.4
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/doc/classes/ActiveRecord/Base.html +12 -12
- data/doc/classes/Cachetastic/Adapters/Base.html +33 -33
- data/doc/classes/Cachetastic/Adapters/Drb.html +42 -42
- data/doc/classes/Cachetastic/Adapters/File.html +18 -18
- data/doc/classes/Cachetastic/Adapters/FileBase.html +36 -36
- data/doc/classes/Cachetastic/Adapters/HtmlFile.html +18 -18
- data/doc/classes/Cachetastic/Adapters/LocalMemory.html +42 -42
- data/doc/classes/Cachetastic/Adapters/Memcache.html +72 -72
- data/doc/classes/Cachetastic/Cacheable.html +16 -16
- data/doc/classes/Cachetastic/Cacheable/ClassAndInstanceMethods.html +18 -18
- data/doc/classes/Cachetastic/Cacheable/ClassOnlyMethods.html +18 -18
- data/doc/classes/Cachetastic/Caches/Base.html +94 -94
- data/doc/classes/Cachetastic/Caches/Base/RegisteredCaches.html +6 -6
- data/doc/classes/Cachetastic/Caches/RailsSessionCache.html +6 -6
- data/doc/classes/Cachetastic/Connection.html +13 -13
- data/doc/classes/Cachetastic/Errors/UnsupportedAdapter.html +6 -6
- data/doc/classes/Cachetastic/Logger.html +6 -6
- data/doc/classes/Object.html +38 -6
- data/doc/classes/String.html +172 -0
- data/doc/created.rid +1 -1
- data/doc/files/lib/cachetastic/ruby_extensions/object_rb.html +1 -1
- data/doc/files/lib/cachetastic/ruby_extensions/string_rb.html +101 -0
- data/doc/files/lib/cachetastic_rb.html +1 -1
- data/doc/fr_class_index.html +1 -0
- data/doc/fr_file_index.html +1 -0
- data/doc/fr_method_index.html +77 -74
- data/lib/cachetastic.rb +1 -0
- data/lib/cachetastic/ruby_extensions/object.rb +14 -0
- data/lib/cachetastic/ruby_extensions/string.rb +15 -0
- data/test/memcache_adapter_test.rb +4 -0
- data/test/test_helper.rb +1 -2
- metadata +5 -2
@@ -112,8 +112,8 @@ Example:
|
|
112
112
|
<h3 class="section-bar">Methods</h3>
|
113
113
|
|
114
114
|
<div class="name-list">
|
115
|
-
<a href="#
|
116
|
-
<a href="#
|
115
|
+
<a href="#M000066">cache_self</a>
|
116
|
+
<a href="#M000067">uncache_self</a>
|
117
117
|
</div>
|
118
118
|
</div>
|
119
119
|
|
@@ -142,11 +142,11 @@ Module <a href="Cacheable/ClassOnlyMethods.html" class="link">Cachetastic::Cache
|
|
142
142
|
<div id="methods">
|
143
143
|
<h3 class="section-bar">Public Instance methods</h3>
|
144
144
|
|
145
|
-
<div id="method-
|
146
|
-
<a name="
|
145
|
+
<div id="method-M000066" class="method-detail">
|
146
|
+
<a name="M000066"></a>
|
147
147
|
|
148
148
|
<div class="method-heading">
|
149
|
-
<a href="#
|
149
|
+
<a href="#M000066" class="method-signature">
|
150
150
|
<span class="method-name">cache_self</span><span class="method-args">()</span>
|
151
151
|
</a>
|
152
152
|
</div>
|
@@ -158,8 +158,8 @@ will store the object in the cache using the object‘s cachetastic_key
|
|
158
158
|
as the key. You <b>MUST</b> create an instance level method called
|
159
159
|
cachetastic_key and have it return a valid key! If you return nil from the
|
160
160
|
cachetastic_key method or you will not be able to use the <a
|
161
|
-
href="Cacheable.html#
|
162
|
-
href="Cacheable.html#
|
161
|
+
href="Cacheable.html#M000066">cache_self</a> and <a
|
162
|
+
href="Cacheable.html#M000067">uncache_self</a> methods.
|
163
163
|
</p>
|
164
164
|
<p>
|
165
165
|
Example:
|
@@ -180,8 +180,8 @@ Example:
|
|
180
180
|
Person.get_from_cache("Mark Bates") # => "Mark Bates"
|
181
181
|
</pre>
|
182
182
|
<p><a class="source-toggle" href="#"
|
183
|
-
onclick="toggleCode('
|
184
|
-
<div class="method-source-code" id="
|
183
|
+
onclick="toggleCode('M000066-source');return false;">[Source]</a></p>
|
184
|
+
<div class="method-source-code" id="M000066-source">
|
185
185
|
<pre>
|
186
186
|
<span class="ruby-comment cmt"># File lib/cachetastic/cacheable.rb, line 142</span>
|
187
187
|
142: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">cache_self</span>
|
@@ -192,11 +192,11 @@ Example:
|
|
192
192
|
</div>
|
193
193
|
</div>
|
194
194
|
|
195
|
-
<div id="method-
|
196
|
-
<a name="
|
195
|
+
<div id="method-M000067" class="method-detail">
|
196
|
+
<a name="M000067"></a>
|
197
197
|
|
198
198
|
<div class="method-heading">
|
199
|
-
<a href="#
|
199
|
+
<a href="#M000067" class="method-signature">
|
200
200
|
<span class="method-name">uncache_self</span><span class="method-args">()</span>
|
201
201
|
</a>
|
202
202
|
</div>
|
@@ -208,8 +208,8 @@ will delete the object in the cache using the object‘s
|
|
208
208
|
cachetastic_key as the key. You <b>MUST</b> create an instance level method
|
209
209
|
called cachetastic_key and have it return a valid key! If you return nil
|
210
210
|
from the cachetastic_key method or you will not be able to use the <a
|
211
|
-
href="Cacheable.html#
|
212
|
-
href="Cacheable.html#
|
211
|
+
href="Cacheable.html#M000066">cache_self</a> and <a
|
212
|
+
href="Cacheable.html#M000067">uncache_self</a> methods.
|
213
213
|
</p>
|
214
214
|
<p>
|
215
215
|
Example:
|
@@ -232,8 +232,8 @@ Example:
|
|
232
232
|
Person.get_from_cache("Mark Bates") # => nil
|
233
233
|
</pre>
|
234
234
|
<p><a class="source-toggle" href="#"
|
235
|
-
onclick="toggleCode('
|
236
|
-
<div class="method-source-code" id="
|
235
|
+
onclick="toggleCode('M000067-source');return false;">[Source]</a></p>
|
236
|
+
<div class="method-source-code" id="M000067-source">
|
237
237
|
<pre>
|
238
238
|
<span class="ruby-comment cmt"># File lib/cachetastic/cacheable.rb, line 168</span>
|
239
239
|
168: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">uncache_self</span>
|
@@ -80,9 +80,9 @@
|
|
80
80
|
<h3 class="section-bar">Methods</h3>
|
81
81
|
|
82
82
|
<div class="name-list">
|
83
|
-
<a href="#
|
84
|
-
<a href="#
|
85
|
-
<a href="#
|
83
|
+
<a href="#M000071">cache_class</a>
|
84
|
+
<a href="#M000072">cacher</a>
|
85
|
+
<a href="#M000073">expire_all</a>
|
86
86
|
</div>
|
87
87
|
</div>
|
88
88
|
|
@@ -104,11 +104,11 @@
|
|
104
104
|
<div id="methods">
|
105
105
|
<h3 class="section-bar">Public Instance methods</h3>
|
106
106
|
|
107
|
-
<div id="method-
|
108
|
-
<a name="
|
107
|
+
<div id="method-M000071" class="method-detail">
|
108
|
+
<a name="M000071"></a>
|
109
109
|
|
110
110
|
<div class="method-heading">
|
111
|
-
<a href="#
|
111
|
+
<a href="#M000071" class="method-signature">
|
112
112
|
<span class="method-name">cache_class</span><span class="method-args">()</span>
|
113
113
|
</a>
|
114
114
|
</div>
|
@@ -136,8 +136,8 @@ Example:
|
|
136
136
|
Person.cache_class # => Cachetastic::Cacheable::PersonCache
|
137
137
|
</pre>
|
138
138
|
<p><a class="source-toggle" href="#"
|
139
|
-
onclick="toggleCode('
|
140
|
-
<div class="method-source-code" id="
|
139
|
+
onclick="toggleCode('M000071-source');return false;">[Source]</a></p>
|
140
|
+
<div class="method-source-code" id="M000071-source">
|
141
141
|
<pre>
|
142
142
|
<span class="ruby-comment cmt"># File lib/cachetastic/cacheable.rb, line 39</span>
|
143
143
|
39: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">cache_class</span>
|
@@ -161,11 +161,11 @@ Example:
|
|
161
161
|
</div>
|
162
162
|
</div>
|
163
163
|
|
164
|
-
<div id="method-
|
165
|
-
<a name="
|
164
|
+
<div id="method-M000072" class="method-detail">
|
165
|
+
<a name="M000072"></a>
|
166
166
|
|
167
167
|
<div class="method-heading">
|
168
|
-
<a href="#
|
168
|
+
<a href="#M000072" class="method-signature">
|
169
169
|
<span class="method-name">cacher</span><span class="method-args">(key, expiry = 0) {|| ...}</span>
|
170
170
|
</a>
|
171
171
|
</div>
|
@@ -207,8 +207,8 @@ Example:
|
|
207
207
|
Cachetastic::Cacheable::PersonCache.get("say_hi") # => "Hi There"
|
208
208
|
</pre>
|
209
209
|
<p><a class="source-toggle" href="#"
|
210
|
-
onclick="toggleCode('
|
211
|
-
<div class="method-source-code" id="
|
210
|
+
onclick="toggleCode('M000072-source');return false;">[Source]</a></p>
|
211
|
+
<div class="method-source-code" id="M000072-source">
|
212
212
|
<pre>
|
213
213
|
<span class="ruby-comment cmt"># File lib/cachetastic/cacheable.rb, line 86</span>
|
214
214
|
86: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">cacher</span>(<span class="ruby-identifier">key</span>, <span class="ruby-identifier">expiry</span> = <span class="ruby-value">0</span>)
|
@@ -224,11 +224,11 @@ Example:
|
|
224
224
|
</div>
|
225
225
|
</div>
|
226
226
|
|
227
|
-
<div id="method-
|
228
|
-
<a name="
|
227
|
+
<div id="method-M000073" class="method-detail">
|
228
|
+
<a name="M000073"></a>
|
229
229
|
|
230
230
|
<div class="method-heading">
|
231
|
-
<a href="#
|
231
|
+
<a href="#M000073" class="method-signature">
|
232
232
|
<span class="method-name">expire_all</span><span class="method-args">()</span>
|
233
233
|
</a>
|
234
234
|
</div>
|
@@ -259,8 +259,8 @@ Example:
|
|
259
259
|
Person.get_from_cache(1) # => nil
|
260
260
|
</pre>
|
261
261
|
<p><a class="source-toggle" href="#"
|
262
|
-
onclick="toggleCode('
|
263
|
-
<div class="method-source-code" id="
|
262
|
+
onclick="toggleCode('M000073-source');return false;">[Source]</a></p>
|
263
|
+
<div class="method-source-code" id="M000073-source">
|
264
264
|
<pre>
|
265
265
|
<span class="ruby-comment cmt"># File lib/cachetastic/cacheable.rb, line 114</span>
|
266
266
|
114: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">expire_all</span>
|
@@ -80,9 +80,9 @@
|
|
80
80
|
<h3 class="section-bar">Methods</h3>
|
81
81
|
|
82
82
|
<div class="name-list">
|
83
|
-
<a href="#
|
84
|
-
<a href="#
|
85
|
-
<a href="#
|
83
|
+
<a href="#M000069">delete_from_cache</a>
|
84
|
+
<a href="#M000068">get_from_cache</a>
|
85
|
+
<a href="#M000070">set_into_cache</a>
|
86
86
|
</div>
|
87
87
|
</div>
|
88
88
|
|
@@ -104,11 +104,11 @@
|
|
104
104
|
<div id="methods">
|
105
105
|
<h3 class="section-bar">Public Instance methods</h3>
|
106
106
|
|
107
|
-
<div id="method-
|
108
|
-
<a name="
|
107
|
+
<div id="method-M000069" class="method-detail">
|
108
|
+
<a name="M000069"></a>
|
109
109
|
|
110
110
|
<div class="method-heading">
|
111
|
-
<a href="#
|
111
|
+
<a href="#M000069" class="method-signature">
|
112
112
|
<span class="method-name">delete_from_cache</span><span class="method-args">(key)</span>
|
113
113
|
</a>
|
114
114
|
</div>
|
@@ -118,8 +118,8 @@
|
|
118
118
|
Deletes an object from the cache for a given key.
|
119
119
|
</p>
|
120
120
|
<p><a class="source-toggle" href="#"
|
121
|
-
onclick="toggleCode('
|
122
|
-
<div class="method-source-code" id="
|
121
|
+
onclick="toggleCode('M000069-source');return false;">[Source]</a></p>
|
122
|
+
<div class="method-source-code" id="M000069-source">
|
123
123
|
<pre>
|
124
124
|
<span class="ruby-comment cmt"># File lib/cachetastic/cacheable.rb, line 187</span>
|
125
125
|
187: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">delete_from_cache</span>(<span class="ruby-identifier">key</span>)
|
@@ -130,11 +130,11 @@ Deletes an object from the cache for a given key.
|
|
130
130
|
</div>
|
131
131
|
</div>
|
132
132
|
|
133
|
-
<div id="method-
|
134
|
-
<a name="
|
133
|
+
<div id="method-M000068" class="method-detail">
|
134
|
+
<a name="M000068"></a>
|
135
135
|
|
136
136
|
<div class="method-heading">
|
137
|
-
<a href="#
|
137
|
+
<a href="#M000068" class="method-signature">
|
138
138
|
<span class="method-name">get_from_cache</span><span class="method-args">(key, &block)</span>
|
139
139
|
</a>
|
140
140
|
</div>
|
@@ -144,8 +144,8 @@ Deletes an object from the cache for a given key.
|
|
144
144
|
Returns an object from the cache for a given key.
|
145
145
|
</p>
|
146
146
|
<p><a class="source-toggle" href="#"
|
147
|
-
onclick="toggleCode('
|
148
|
-
<div class="method-source-code" id="
|
147
|
+
onclick="toggleCode('M000068-source');return false;">[Source]</a></p>
|
148
|
+
<div class="method-source-code" id="M000068-source">
|
149
149
|
<pre>
|
150
150
|
<span class="ruby-comment cmt"># File lib/cachetastic/cacheable.rb, line 182</span>
|
151
151
|
182: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">get_from_cache</span>(<span class="ruby-identifier">key</span>, <span class="ruby-operator">&</span><span class="ruby-identifier">block</span>)
|
@@ -156,11 +156,11 @@ Returns an object from the cache for a given key.
|
|
156
156
|
</div>
|
157
157
|
</div>
|
158
158
|
|
159
|
-
<div id="method-
|
160
|
-
<a name="
|
159
|
+
<div id="method-M000070" class="method-detail">
|
160
|
+
<a name="M000070"></a>
|
161
161
|
|
162
162
|
<div class="method-heading">
|
163
|
-
<a href="#
|
163
|
+
<a href="#M000070" class="method-signature">
|
164
164
|
<span class="method-name">set_into_cache</span><span class="method-args">(key, value, expiry = 0)</span>
|
165
165
|
</a>
|
166
166
|
</div>
|
@@ -170,8 +170,8 @@ Returns an object from the cache for a given key.
|
|
170
170
|
Sets an object into the cache for a given key.
|
171
171
|
</p>
|
172
172
|
<p><a class="source-toggle" href="#"
|
173
|
-
onclick="toggleCode('
|
174
|
-
<div class="method-source-code" id="
|
173
|
+
onclick="toggleCode('M000070-source');return false;">[Source]</a></p>
|
174
|
+
<div class="method-source-code" id="M000070-source">
|
175
175
|
<pre>
|
176
176
|
<span class="ruby-comment cmt"># File lib/cachetastic/cacheable.rb, line 192</span>
|
177
177
|
192: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">set_into_cache</span>(<span class="ruby-identifier">key</span>, <span class="ruby-identifier">value</span>, <span class="ruby-identifier">expiry</span> = <span class="ruby-value">0</span>)
|
@@ -120,20 +120,20 @@ different for your cache.
|
|
120
120
|
<h3 class="section-bar">Methods</h3>
|
121
121
|
|
122
122
|
<div class="name-list">
|
123
|
-
<a href="#
|
124
|
-
<a href="#
|
125
|
-
<a href="#
|
126
|
-
<a href="#
|
127
|
-
<a href="#
|
128
|
-
<a href="#
|
129
|
-
<a href="#
|
130
|
-
<a href="#
|
131
|
-
<a href="#
|
132
|
-
<a href="#
|
133
|
-
<a href="#
|
134
|
-
<a href="#
|
135
|
-
<a href="#
|
136
|
-
<a href="#
|
123
|
+
<a href="#M000058">adapter</a>
|
124
|
+
<a href="#M000061">adapter_supported?</a>
|
125
|
+
<a href="#M000051">all_registered_caches</a>
|
126
|
+
<a href="#M000057">cache_name</a>
|
127
|
+
<a href="#M000064">calculate_expiry_time</a>
|
128
|
+
<a href="#M000054">delete</a>
|
129
|
+
<a href="#M000055">expire_all</a>
|
130
|
+
<a href="#M000052">get</a>
|
131
|
+
<a href="#M000059">logger</a>
|
132
|
+
<a href="#M000062">marshall</a>
|
133
|
+
<a href="#M000053">set</a>
|
134
|
+
<a href="#M000056">stats</a>
|
135
|
+
<a href="#M000063">unmarshall</a>
|
136
|
+
<a href="#M000060">unsupported_adapters</a>
|
137
137
|
</div>
|
138
138
|
</div>
|
139
139
|
|
@@ -174,11 +174,11 @@ different for your cache.
|
|
174
174
|
<div id="methods">
|
175
175
|
<h3 class="section-bar">Public Class methods</h3>
|
176
176
|
|
177
|
-
<div id="method-
|
178
|
-
<a name="
|
177
|
+
<div id="method-M000058" class="method-detail">
|
178
|
+
<a name="M000058"></a>
|
179
179
|
|
180
180
|
<div class="method-heading">
|
181
|
-
<a href="#
|
181
|
+
<a href="#M000058" class="method-signature">
|
182
182
|
<span class="method-name">adapter</span><span class="method-args">()</span>
|
183
183
|
</a>
|
184
184
|
</div>
|
@@ -190,8 +190,8 @@ href="../Adapters/Base.html">Cachetastic::Adapters::Base</a> for this
|
|
190
190
|
cache.
|
191
191
|
</p>
|
192
192
|
<p><a class="source-toggle" href="#"
|
193
|
-
onclick="toggleCode('
|
194
|
-
<div class="method-source-code" id="
|
193
|
+
onclick="toggleCode('M000058-source');return false;">[Source]</a></p>
|
194
|
+
<div class="method-source-code" id="M000058-source">
|
195
195
|
<pre>
|
196
196
|
<span class="ruby-comment cmt"># File lib/cachetastic/caches/base.rb, line 139</span>
|
197
197
|
139: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">adapter</span>
|
@@ -207,23 +207,23 @@ cache.
|
|
207
207
|
</div>
|
208
208
|
</div>
|
209
209
|
|
210
|
-
<div id="method-
|
211
|
-
<a name="
|
210
|
+
<div id="method-M000061" class="method-detail">
|
211
|
+
<a name="M000061"></a>
|
212
212
|
|
213
213
|
<div class="method-heading">
|
214
|
-
<a href="#
|
214
|
+
<a href="#M000061" class="method-signature">
|
215
215
|
<span class="method-name">adapter_supported?</span><span class="method-args">(a = cache_conn_instance.get(cache_name).class)</span>
|
216
216
|
</a>
|
217
217
|
</div>
|
218
218
|
|
219
219
|
<div class="method-description">
|
220
220
|
<p>
|
221
|
-
Returns true/false on whether the <a href="Base.html#
|
221
|
+
Returns true/false on whether the <a href="Base.html#M000058">adapter</a>
|
222
222
|
you want to use is supported for the cache.
|
223
223
|
</p>
|
224
224
|
<p><a class="source-toggle" href="#"
|
225
|
-
onclick="toggleCode('
|
226
|
-
<div class="method-source-code" id="
|
225
|
+
onclick="toggleCode('M000061-source');return false;">[Source]</a></p>
|
226
|
+
<div class="method-source-code" id="M000061-source">
|
227
227
|
<pre>
|
228
228
|
<span class="ruby-comment cmt"># File lib/cachetastic/caches/base.rb, line 161</span>
|
229
229
|
161: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">adapter_supported?</span>(<span class="ruby-identifier">a</span> = <span class="ruby-identifier">cache_conn_instance</span>.<span class="ruby-identifier">get</span>(<span class="ruby-identifier">cache_name</span>).<span class="ruby-identifier">class</span>)
|
@@ -234,11 +234,11 @@ you want to use is supported for the cache.
|
|
234
234
|
</div>
|
235
235
|
</div>
|
236
236
|
|
237
|
-
<div id="method-
|
238
|
-
<a name="
|
237
|
+
<div id="method-M000051" class="method-detail">
|
238
|
+
<a name="M000051"></a>
|
239
239
|
|
240
240
|
<div class="method-heading">
|
241
|
-
<a href="#
|
241
|
+
<a href="#M000051" class="method-signature">
|
242
242
|
<span class="method-name">all_registered_caches</span><span class="method-args">()</span>
|
243
243
|
</a>
|
244
244
|
</div>
|
@@ -248,8 +248,8 @@ you want to use is supported for the cache.
|
|
248
248
|
Returns a list of all registered caches in the system.
|
249
249
|
</p>
|
250
250
|
<p><a class="source-toggle" href="#"
|
251
|
-
onclick="toggleCode('
|
252
|
-
<div class="method-source-code" id="
|
251
|
+
onclick="toggleCode('M000051-source');return false;">[Source]</a></p>
|
252
|
+
<div class="method-source-code" id="M000051-source">
|
253
253
|
<pre>
|
254
254
|
<span class="ruby-comment cmt"># File lib/cachetastic/caches/base.rb, line 48</span>
|
255
255
|
48: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">all_registered_caches</span>
|
@@ -260,11 +260,11 @@ Returns a list of all registered caches in the system.
|
|
260
260
|
</div>
|
261
261
|
</div>
|
262
262
|
|
263
|
-
<div id="method-
|
264
|
-
<a name="
|
263
|
+
<div id="method-M000057" class="method-detail">
|
264
|
+
<a name="M000057"></a>
|
265
265
|
|
266
266
|
<div class="method-heading">
|
267
|
-
<a href="#
|
267
|
+
<a href="#M000057" class="method-signature">
|
268
268
|
<span class="method-name">cache_name</span><span class="method-args">()</span>
|
269
269
|
</a>
|
270
270
|
</div>
|
@@ -280,8 +280,8 @@ href="../Connection.html">Cachetastic::Connection</a> class.
|
|
280
280
|
Cachetastic::Caches::Base # => "cachetastic_caches_base"
|
281
281
|
</pre>
|
282
282
|
<p><a class="source-toggle" href="#"
|
283
|
-
onclick="toggleCode('
|
284
|
-
<div class="method-source-code" id="
|
283
|
+
onclick="toggleCode('M000057-source');return false;">[Source]</a></p>
|
284
|
+
<div class="method-source-code" id="M000057-source">
|
285
285
|
<pre>
|
286
286
|
<span class="ruby-comment cmt"># File lib/cachetastic/caches/base.rb, line 134</span>
|
287
287
|
134: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">cache_name</span>
|
@@ -292,11 +292,11 @@ href="../Connection.html">Cachetastic::Connection</a> class.
|
|
292
292
|
</div>
|
293
293
|
</div>
|
294
294
|
|
295
|
-
<div id="method-
|
296
|
-
<a name="
|
295
|
+
<div id="method-M000054" class="method-detail">
|
296
|
+
<a name="M000054"></a>
|
297
297
|
|
298
298
|
<div class="method-heading">
|
299
|
-
<a href="#
|
299
|
+
<a href="#M000054" class="method-signature">
|
300
300
|
<span class="method-name">delete</span><span class="method-args">(key, delay = 0)</span>
|
301
301
|
</a>
|
302
302
|
</div>
|
@@ -305,12 +305,12 @@ href="../Connection.html">Cachetastic::Connection</a> class.
|
|
305
305
|
<p>
|
306
306
|
Deletes an object from the cache. The optional delay parameter sets an
|
307
307
|
offset, in seconds, for when the object should <a
|
308
|
-
href="Base.html#
|
308
|
+
href="Base.html#M000052">get</a> deleted. The default of 0 means the object
|
309
309
|
gets deleted right away.
|
310
310
|
</p>
|
311
311
|
<p><a class="source-toggle" href="#"
|
312
|
-
onclick="toggleCode('
|
313
|
-
<div class="method-source-code" id="
|
312
|
+
onclick="toggleCode('M000054-source');return false;">[Source]</a></p>
|
313
|
+
<div class="method-source-code" id="M000054-source">
|
314
314
|
<pre>
|
315
315
|
<span class="ruby-comment cmt"># File lib/cachetastic/caches/base.rb, line 108</span>
|
316
316
|
108: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">delete</span>(<span class="ruby-identifier">key</span>, <span class="ruby-identifier">delay</span> = <span class="ruby-value">0</span>)
|
@@ -323,11 +323,11 @@ gets deleted right away.
|
|
323
323
|
</div>
|
324
324
|
</div>
|
325
325
|
|
326
|
-
<div id="method-
|
327
|
-
<a name="
|
326
|
+
<div id="method-M000055" class="method-detail">
|
327
|
+
<a name="M000055"></a>
|
328
328
|
|
329
329
|
<div class="method-heading">
|
330
|
-
<a href="#
|
330
|
+
<a href="#M000055" class="method-signature">
|
331
331
|
<span class="method-name">expire_all</span><span class="method-args">()</span>
|
332
332
|
</a>
|
333
333
|
</div>
|
@@ -337,8 +337,8 @@ gets deleted right away.
|
|
337
337
|
Expires all objects for this cache.
|
338
338
|
</p>
|
339
339
|
<p><a class="source-toggle" href="#"
|
340
|
-
onclick="toggleCode('
|
341
|
-
<div class="method-source-code" id="
|
340
|
+
onclick="toggleCode('M000055-source');return false;">[Source]</a></p>
|
341
|
+
<div class="method-source-code" id="M000055-source">
|
342
342
|
<pre>
|
343
343
|
<span class="ruby-comment cmt"># File lib/cachetastic/caches/base.rb, line 115</span>
|
344
344
|
115: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">expire_all</span>
|
@@ -350,11 +350,11 @@ Expires all objects for this cache.
|
|
350
350
|
</div>
|
351
351
|
</div>
|
352
352
|
|
353
|
-
<div id="method-
|
354
|
-
<a name="
|
353
|
+
<div id="method-M000052" class="method-detail">
|
354
|
+
<a name="M000052"></a>
|
355
355
|
|
356
356
|
<div class="method-heading">
|
357
|
-
<a href="#
|
357
|
+
<a href="#M000052" class="method-signature">
|
358
358
|
<span class="method-name">get</span><span class="method-args">(key) {|key if block_given?| ...}</span>
|
359
359
|
</a>
|
360
360
|
</div>
|
@@ -364,12 +364,12 @@ Expires all objects for this cache.
|
|
364
364
|
Returns an object from the cache for a given key. If the object comes back
|
365
365
|
as nil and a block is given that block will be run and the results of the
|
366
366
|
block will be run. This can be used to JIT caches, just make sure in the
|
367
|
-
block to call the <a href="Base.html#
|
367
|
+
block to call the <a href="Base.html#M000053">set</a> method because the
|
368
368
|
results of the block are not automatically cached.
|
369
369
|
</p>
|
370
370
|
<p><a class="source-toggle" href="#"
|
371
|
-
onclick="toggleCode('
|
372
|
-
<div class="method-source-code" id="
|
371
|
+
onclick="toggleCode('M000052-source');return false;">[Source]</a></p>
|
372
|
+
<div class="method-source-code" id="M000052-source">
|
373
373
|
<pre>
|
374
374
|
<span class="ruby-comment cmt"># File lib/cachetastic/caches/base.rb, line 58</span>
|
375
375
|
58: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">get</span>(<span class="ruby-identifier">key</span>, <span class="ruby-operator">&</span><span class="ruby-identifier">block</span>)
|
@@ -405,11 +405,11 @@ results of the block are not automatically cached.
|
|
405
405
|
</div>
|
406
406
|
</div>
|
407
407
|
|
408
|
-
<div id="method-
|
409
|
-
<a name="
|
408
|
+
<div id="method-M000059" class="method-detail">
|
409
|
+
<a name="M000059"></a>
|
410
410
|
|
411
411
|
<div class="method-heading">
|
412
|
-
<a href="#
|
412
|
+
<a href="#M000059" class="method-signature">
|
413
413
|
<span class="method-name">logger</span><span class="method-args">()</span>
|
414
414
|
</a>
|
415
415
|
</div>
|
@@ -420,8 +420,8 @@ Returns the <a href="../Logger.html">Cachetastic::Logger</a> for the
|
|
420
420
|
underlying <a href="../Adapters/Base.html">Cachetastic::Adapters::Base</a>.
|
421
421
|
</p>
|
422
422
|
<p><a class="source-toggle" href="#"
|
423
|
-
onclick="toggleCode('
|
424
|
-
<div class="method-source-code" id="
|
423
|
+
onclick="toggleCode('M000059-source');return false;">[Source]</a></p>
|
424
|
+
<div class="method-source-code" id="M000059-source">
|
425
425
|
<pre>
|
426
426
|
<span class="ruby-comment cmt"># File lib/cachetastic/caches/base.rb, line 149</span>
|
427
427
|
149: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">logger</span>
|
@@ -432,19 +432,19 @@ underlying <a href="../Adapters/Base.html">Cachetastic::Adapters::Base</a>.
|
|
432
432
|
</div>
|
433
433
|
</div>
|
434
434
|
|
435
|
-
<div id="method-
|
436
|
-
<a name="
|
435
|
+
<div id="method-M000062" class="method-detail">
|
436
|
+
<a name="M000062"></a>
|
437
437
|
|
438
438
|
<div class="method-heading">
|
439
|
-
<a href="#
|
439
|
+
<a href="#M000062" class="method-signature">
|
440
440
|
<span class="method-name">marshall</span><span class="method-args">(value)</span>
|
441
441
|
</a>
|
442
442
|
</div>
|
443
443
|
|
444
444
|
<div class="method-description">
|
445
445
|
<p><a class="source-toggle" href="#"
|
446
|
-
onclick="toggleCode('
|
447
|
-
<div class="method-source-code" id="
|
446
|
+
onclick="toggleCode('M000062-source');return false;">[Source]</a></p>
|
447
|
+
<div class="method-source-code" id="M000062-source">
|
448
448
|
<pre>
|
449
449
|
<span class="ruby-comment cmt"># File lib/cachetastic/caches/base.rb, line 165</span>
|
450
450
|
165: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">marshall</span>(<span class="ruby-identifier">value</span>)
|
@@ -463,11 +463,11 @@ underlying <a href="../Adapters/Base.html">Cachetastic::Adapters::Base</a>.
|
|
463
463
|
</div>
|
464
464
|
</div>
|
465
465
|
|
466
|
-
<div id="method-
|
467
|
-
<a name="
|
466
|
+
<div id="method-M000053" class="method-detail">
|
467
|
+
<a name="M000053"></a>
|
468
468
|
|
469
469
|
<div class="method-heading">
|
470
|
-
<a href="#
|
470
|
+
<a href="#M000053" class="method-signature">
|
471
471
|
<span class="method-name">set</span><span class="method-args">(key, value, expiry = adapter.configuration.retrieve(:default_expiry, 0))</span>
|
472
472
|
</a>
|
473
473
|
</div>
|
@@ -476,16 +476,16 @@ underlying <a href="../Adapters/Base.html">Cachetastic::Adapters::Base</a>.
|
|
476
476
|
<p>
|
477
477
|
Set a particular object info the cache for the given key. An optional third
|
478
478
|
parameter sets the expiry time for the object in the cache. The default for
|
479
|
-
this expiry is <a href="Base.html#
|
479
|
+
this expiry is <a href="Base.html#M000053">set</a> as either 0, meaning it
|
480
480
|
never expires, or if there‘s a default_expiry time <a
|
481
|
-
href="Base.html#
|
482
|
-
used. If there is an expiry_swing <a href="Base.html#
|
481
|
+
href="Base.html#M000053">set</a> in the config file, that file will be
|
482
|
+
used. If there is an expiry_swing <a href="Base.html#M000053">set</a> in
|
483
483
|
the config file it will be +/- to the expiry time. See also: <a
|
484
|
-
href="Base.html#
|
484
|
+
href="Base.html#M000064">calculate_expiry_time</a>
|
485
485
|
</p>
|
486
486
|
<p><a class="source-toggle" href="#"
|
487
|
-
onclick="toggleCode('
|
488
|
-
<div class="method-source-code" id="
|
487
|
+
onclick="toggleCode('M000053-source');return false;">[Source]</a></p>
|
488
|
+
<div class="method-source-code" id="M000053-source">
|
489
489
|
<pre>
|
490
490
|
<span class="ruby-comment cmt"># File lib/cachetastic/caches/base.rb, line 94</span>
|
491
491
|
94: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">set</span>(<span class="ruby-identifier">key</span>, <span class="ruby-identifier">value</span>, <span class="ruby-identifier">expiry</span> = <span class="ruby-identifier">adapter</span>.<span class="ruby-identifier">configuration</span>.<span class="ruby-identifier">retrieve</span>(<span class="ruby-identifier">:default_expiry</span>, <span class="ruby-value">0</span>))
|
@@ -501,11 +501,11 @@ href="Base.html#M000061">calculate_expiry_time</a>
|
|
501
501
|
</div>
|
502
502
|
</div>
|
503
503
|
|
504
|
-
<div id="method-
|
505
|
-
<a name="
|
504
|
+
<div id="method-M000056" class="method-detail">
|
505
|
+
<a name="M000056"></a>
|
506
506
|
|
507
507
|
<div class="method-heading">
|
508
|
-
<a href="#
|
508
|
+
<a href="#M000056" class="method-signature">
|
509
509
|
<span class="method-name">stats</span><span class="method-args">()</span>
|
510
510
|
</a>
|
511
511
|
</div>
|
@@ -516,8 +516,8 @@ A convenience method that returns statistics for the underlying <a
|
|
516
516
|
href="../Adapters/Base.html">Cachetastic::Adapters::Base</a> for the cache.
|
517
517
|
</p>
|
518
518
|
<p><a class="source-toggle" href="#"
|
519
|
-
onclick="toggleCode('
|
520
|
-
<div class="method-source-code" id="
|
519
|
+
onclick="toggleCode('M000056-source');return false;">[Source]</a></p>
|
520
|
+
<div class="method-source-code" id="M000056-source">
|
521
521
|
<pre>
|
522
522
|
<span class="ruby-comment cmt"># File lib/cachetastic/caches/base.rb, line 126</span>
|
523
523
|
126: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">stats</span>
|
@@ -528,19 +528,19 @@ href="../Adapters/Base.html">Cachetastic::Adapters::Base</a> for the cache.
|
|
528
528
|
</div>
|
529
529
|
</div>
|
530
530
|
|
531
|
-
<div id="method-
|
532
|
-
<a name="
|
531
|
+
<div id="method-M000063" class="method-detail">
|
532
|
+
<a name="M000063"></a>
|
533
533
|
|
534
534
|
<div class="method-heading">
|
535
|
-
<a href="#
|
535
|
+
<a href="#M000063" class="method-signature">
|
536
536
|
<span class="method-name">unmarshall</span><span class="method-args">(value)</span>
|
537
537
|
</a>
|
538
538
|
</div>
|
539
539
|
|
540
540
|
<div class="method-description">
|
541
541
|
<p><a class="source-toggle" href="#"
|
542
|
-
onclick="toggleCode('
|
543
|
-
<div class="method-source-code" id="
|
542
|
+
onclick="toggleCode('M000063-source');return false;">[Source]</a></p>
|
543
|
+
<div class="method-source-code" id="M000063-source">
|
544
544
|
<pre>
|
545
545
|
<span class="ruby-comment cmt"># File lib/cachetastic/caches/base.rb, line 177</span>
|
546
546
|
177: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">unmarshall</span>(<span class="ruby-identifier">value</span>)
|
@@ -559,11 +559,11 @@ href="../Adapters/Base.html">Cachetastic::Adapters::Base</a> for the cache.
|
|
559
559
|
</div>
|
560
560
|
</div>
|
561
561
|
|
562
|
-
<div id="method-
|
563
|
-
<a name="
|
562
|
+
<div id="method-M000060" class="method-detail">
|
563
|
+
<a name="M000060"></a>
|
564
564
|
|
565
565
|
<div class="method-heading">
|
566
|
-
<a href="#
|
566
|
+
<a href="#M000060" class="method-signature">
|
567
567
|
<span class="method-name">unsupported_adapters</span><span class="method-args">()</span>
|
568
568
|
</a>
|
569
569
|
</div>
|
@@ -571,13 +571,13 @@ href="../Adapters/Base.html">Cachetastic::Adapters::Base</a> for the cache.
|
|
571
571
|
<div class="method-description">
|
572
572
|
<p>
|
573
573
|
Returns an array of unsupported adapters for this cache. Defaults to an
|
574
|
-
empty array which will let any <a href="Base.html#
|
574
|
+
empty array which will let any <a href="Base.html#M000058">adapter</a> be
|
575
575
|
used by the cache. Override in your specific cache to prevent certain
|
576
576
|
adapters.
|
577
577
|
</p>
|
578
578
|
<p><a class="source-toggle" href="#"
|
579
|
-
onclick="toggleCode('
|
580
|
-
<div class="method-source-code" id="
|
579
|
+
onclick="toggleCode('M000060-source');return false;">[Source]</a></p>
|
580
|
+
<div class="method-source-code" id="M000060-source">
|
581
581
|
<pre>
|
582
582
|
<span class="ruby-comment cmt"># File lib/cachetastic/caches/base.rb, line 156</span>
|
583
583
|
156: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">unsupported_adapters</span>
|
@@ -590,24 +590,24 @@ adapters.
|
|
590
590
|
|
591
591
|
<h3 class="section-bar">Private Class methods</h3>
|
592
592
|
|
593
|
-
<div id="method-
|
594
|
-
<a name="
|
593
|
+
<div id="method-M000064" class="method-detail">
|
594
|
+
<a name="M000064"></a>
|
595
595
|
|
596
596
|
<div class="method-heading">
|
597
|
-
<a href="#
|
597
|
+
<a href="#M000064" class="method-signature">
|
598
598
|
<span class="method-name">calculate_expiry_time</span><span class="method-args">(expiry)</span>
|
599
599
|
</a>
|
600
600
|
</div>
|
601
601
|
|
602
602
|
<div class="method-description">
|
603
603
|
<p>
|
604
|
-
If the expiry time is <a href="Base.html#
|
605
|
-
the expiry_swing time is <a href="Base.html#
|
604
|
+
If the expiry time is <a href="Base.html#M000053">set</a> to 60 minutes and
|
605
|
+
the expiry_swing time is <a href="Base.html#M000053">set</a> to 15 minutes,
|
606
606
|
this method will return a number between 45 minutes and 75 minutes.
|
607
607
|
</p>
|
608
608
|
<p><a class="source-toggle" href="#"
|
609
|
-
onclick="toggleCode('
|
610
|
-
<div class="method-source-code" id="
|
609
|
+
onclick="toggleCode('M000064-source');return false;">[Source]</a></p>
|
610
|
+
<div class="method-source-code" id="M000064-source">
|
611
611
|
<pre>
|
612
612
|
<span class="ruby-comment cmt"># File lib/cachetastic/caches/base.rb, line 192</span>
|
613
613
|
192: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">calculate_expiry_time</span>(<span class="ruby-identifier">expiry</span>) <span class="ruby-comment cmt"># :doc:</span>
|