cachetastic 1.7.4 → 2.0.0

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.
Files changed (76) hide show
  1. data/README +31 -44
  2. data/bin/cachetastic_drb_server +115 -0
  3. data/doc/classes/ActiveRecord/Base.html +16 -16
  4. data/doc/classes/CGI/Session/CachetasticStore.html +2 -2
  5. data/doc/classes/Cachetastic/Adapters/Base.html +74 -67
  6. data/doc/classes/Cachetastic/Adapters/Drb.html +11 -11
  7. data/doc/classes/Cachetastic/Adapters/File.html +5 -5
  8. data/doc/classes/Cachetastic/Adapters/FileBase.html +45 -45
  9. data/doc/classes/Cachetastic/Adapters/HtmlFile.html +23 -23
  10. data/doc/classes/Cachetastic/Adapters/LocalMemory.html +51 -51
  11. data/doc/classes/Cachetastic/Adapters/Memcache.html +89 -89
  12. data/doc/classes/Cachetastic/Cacheable.html +22 -22
  13. data/doc/classes/Cachetastic/Cacheable/ClassAndInstanceMethods.html +23 -23
  14. data/doc/classes/Cachetastic/Cacheable/ClassOnlyMethods.html +23 -23
  15. data/doc/classes/Cachetastic/Caches/Base.html +170 -199
  16. data/doc/classes/Cachetastic/Caches/Base/RegisteredCaches.html +9 -9
  17. data/doc/classes/Cachetastic/Caches/MackSessionCache.html +2 -2
  18. data/doc/classes/Cachetastic/Caches/PageCache.html +2 -2
  19. data/doc/classes/Cachetastic/Caches/RailsSessionCache.html +9 -9
  20. data/doc/classes/Cachetastic/Connection.html +5 -5
  21. data/doc/classes/Cachetastic/Errors/UnsupportedAdapter.html +9 -9
  22. data/doc/classes/Cachetastic/Logger.html +23 -24
  23. data/doc/classes/Object.html +41 -3
  24. data/doc/created.rid +1 -1
  25. data/doc/files/README.html +33 -52
  26. data/doc/files/lib/{adapters/cachetastic_adapters_base_rb.html → cachetastic/adapters/base_rb.html} +6 -6
  27. data/doc/files/lib/{adapters/cachetastic_adapters_drb_rb.html → cachetastic/adapters/drb_rb.html} +5 -5
  28. data/doc/files/lib/{adapters/cachetastic_adapters_file_base_rb.html → cachetastic/adapters/file_base_rb.html} +5 -5
  29. data/doc/files/lib/{adapters/cachetastic_adapters_file_rb.html → cachetastic/adapters/file_rb.html} +5 -5
  30. data/doc/files/lib/{adapters/cachetastic_adapters_html_file_rb.html → cachetastic/adapters/html_file_rb.html} +5 -5
  31. data/doc/files/lib/{adapters/cachetastic_adapters_local_memory_rb.html → cachetastic/adapters/local_memory_rb.html} +5 -5
  32. data/doc/files/lib/{adapters/cachetastic_adapters_memcache_rb.html → cachetastic/adapters/memcache_rb.html} +5 -5
  33. data/doc/files/lib/{cachetastic_cacheable_rb.html → cachetastic/adapters/store_object_rb.html} +5 -5
  34. data/doc/files/lib/{ruby_extensions/object_rb.html → cachetastic/cacheable_rb.html} +4 -4
  35. data/doc/files/lib/{caches/cachetastic_caches_base_rb.html → cachetastic/caches/base_rb.html} +5 -5
  36. data/doc/files/lib/{cachetastic_connection_rb.html → cachetastic/caches/mack_session_cache_rb.html} +6 -6
  37. data/doc/files/lib/{caches/cachetastic_caches_page_cache_rb.html → cachetastic/caches/page_cache_rb.html} +5 -5
  38. data/doc/files/lib/{caches/cachetastic_caches_rails_session_cache_rb.html → cachetastic/caches/rails_session_cache_rb.html} +5 -5
  39. data/doc/files/lib/{caches/cachetastic_caches_mack_session_cache_rb.html → cachetastic/connection_rb.html} +5 -5
  40. data/doc/files/lib/{adapters/cachetastic_adapters_store_object_rb.html → cachetastic/errors/unsupported_adapter_rb.html} +5 -5
  41. data/doc/files/lib/{cachetastic_logger_rb.html → cachetastic/logger_rb.html} +5 -5
  42. data/doc/files/lib/{rails_extensions/cachetastic_active_record_base_rb.html → cachetastic/rails_extensions/active_record_base_rb.html} +5 -5
  43. data/doc/files/lib/{rails_extensions/cgi_session_cachetastic_store_rb.html → cachetastic/rails_extensions/cgi_session_store_rb.html} +5 -5
  44. data/doc/files/lib/cachetastic/ruby_extensions/object_rb.html +101 -0
  45. data/doc/files/lib/cachetastic_rb.html +34 -53
  46. data/doc/fr_file_index.html +19 -19
  47. data/doc/fr_method_index.html +63 -62
  48. data/lib/cachetastic.rb +35 -22
  49. data/lib/{adapters/cachetastic_adapters_base.rb → cachetastic/adapters/base.rb} +23 -30
  50. data/lib/{adapters/cachetastic_adapters_drb.rb → cachetastic/adapters/drb.rb} +2 -2
  51. data/lib/{adapters/cachetastic_adapters_file.rb → cachetastic/adapters/file.rb} +0 -0
  52. data/lib/{adapters/cachetastic_adapters_file_base.rb → cachetastic/adapters/file_base.rb} +1 -1
  53. data/lib/{adapters/cachetastic_adapters_html_file.rb → cachetastic/adapters/html_file.rb} +0 -0
  54. data/lib/{adapters/cachetastic_adapters_local_memory.rb → cachetastic/adapters/local_memory.rb} +0 -0
  55. data/lib/{adapters/cachetastic_adapters_memcache.rb → cachetastic/adapters/memcache.rb} +3 -3
  56. data/lib/{adapters/cachetastic_adapters_store_object.rb → cachetastic/adapters/store_object.rb} +0 -0
  57. data/lib/{cachetastic_cacheable.rb → cachetastic/cacheable.rb} +0 -0
  58. data/lib/{caches/cachetastic_caches_base.rb → cachetastic/caches/base.rb} +11 -13
  59. data/lib/{caches/cachetastic_caches_mack_session_cache.rb → cachetastic/caches/mack_session_cache.rb} +0 -0
  60. data/lib/{caches/cachetastic_caches_page_cache.rb → cachetastic/caches/page_cache.rb} +0 -0
  61. data/lib/{caches/cachetastic_caches_rails_session_cache.rb → cachetastic/caches/rails_session_cache.rb} +0 -0
  62. data/lib/{cachetastic_connection.rb → cachetastic/connection.rb} +1 -1
  63. data/lib/{errors/cachetastic_errors_unsupported_adapter.rb → cachetastic/errors/unsupported_adapter.rb} +0 -0
  64. data/lib/cachetastic/logger.rb +49 -0
  65. data/lib/{rails_extensions/cachetastic_active_record_base.rb → cachetastic/rails_extensions/active_record_base.rb} +0 -0
  66. data/lib/{rails_extensions/cgi_session_cachetastic_store.rb → cachetastic/rails_extensions/cgi_session_store.rb} +0 -0
  67. data/lib/{ruby_extensions → cachetastic/ruby_extensions}/object.rb +0 -0
  68. data/test/config.rb +30 -0
  69. data/test/drb_adapter_test.rb +14 -0
  70. data/test/memcache_adapter_test.rb +14 -0
  71. data/test/test_helper.rb +8 -22
  72. metadata +58 -47
  73. data/doc/files/lib/errors/cachetastic_errors_unsupported_adapter_rb.html +0 -101
  74. data/lib/cachetastic_logger.rb +0 -44
  75. data/test/config.yml +0 -71
  76. data/test/data_mapper_test.rb +0 -9
@@ -55,8 +55,8 @@
55
55
  <tr class="top-aligned-row">
56
56
  <td><strong>In:</strong></td>
57
57
  <td>
58
- <a href="../../../files/lib/cachetastic_cacheable_rb.html">
59
- lib/cachetastic_cacheable.rb
58
+ <a href="../../../files/lib/cachetastic/cacheable_rb.html">
59
+ lib/cachetastic/cacheable.rb
60
60
  </a>
61
61
  <br />
62
62
  </td>
@@ -80,9 +80,9 @@
80
80
  <h3 class="section-bar">Methods</h3>
81
81
 
82
82
  <div class="name-list">
83
- <a href="#M000049">cache_class</a>&nbsp;&nbsp;
84
- <a href="#M000050">cacher</a>&nbsp;&nbsp;
85
- <a href="#M000051">expire_all</a>&nbsp;&nbsp;
83
+ <a href="#M000068">cache_class</a>&nbsp;&nbsp;
84
+ <a href="#M000069">cacher</a>&nbsp;&nbsp;
85
+ <a href="#M000070">expire_all</a>&nbsp;&nbsp;
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-M000049" class="method-detail">
108
- <a name="M000049"></a>
107
+ <div id="method-M000068" class="method-detail">
108
+ <a name="M000068"></a>
109
109
 
110
110
  <div class="method-heading">
111
- <a href="#M000049" class="method-signature">
111
+ <a href="#M000068" class="method-signature">
112
112
  <span class="method-name">cache_class</span><span class="method-args">()</span>
113
113
  </a>
114
114
  </div>
@@ -136,10 +136,10 @@ Example:
136
136
  Person.cache_class # =&gt; Cachetastic::Cacheable::PersonCache
137
137
  </pre>
138
138
  <p><a class="source-toggle" href="#"
139
- onclick="toggleCode('M000049-source');return false;">[Source]</a></p>
140
- <div class="method-source-code" id="M000049-source">
139
+ onclick="toggleCode('M000068-source');return false;">[Source]</a></p>
140
+ <div class="method-source-code" id="M000068-source">
141
141
  <pre>
142
- <span class="ruby-comment cmt"># File lib/cachetastic_cacheable.rb, line 39</span>
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>
144
144
  40: <span class="ruby-identifier">n</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">name</span>
145
145
  41: <span class="ruby-identifier">n</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">name</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">n</span> <span class="ruby-operator">==</span> <span class="ruby-value str">&quot;Class&quot;</span>
@@ -159,11 +159,11 @@ Example:
159
159
  </div>
160
160
  </div>
161
161
 
162
- <div id="method-M000050" class="method-detail">
163
- <a name="M000050"></a>
162
+ <div id="method-M000069" class="method-detail">
163
+ <a name="M000069"></a>
164
164
 
165
165
  <div class="method-heading">
166
- <a href="#M000050" class="method-signature">
166
+ <a href="#M000069" class="method-signature">
167
167
  <span class="method-name">cacher</span><span class="method-args">(key, expiry = 0) {|| ...}</span>
168
168
  </a>
169
169
  </div>
@@ -205,10 +205,10 @@ Example:
205
205
  Cachetastic::Cacheable::PersonCache.get(&quot;say_hi&quot;) # =&gt; &quot;Hi There&quot;
206
206
  </pre>
207
207
  <p><a class="source-toggle" href="#"
208
- onclick="toggleCode('M000050-source');return false;">[Source]</a></p>
209
- <div class="method-source-code" id="M000050-source">
208
+ onclick="toggleCode('M000069-source');return false;">[Source]</a></p>
209
+ <div class="method-source-code" id="M000069-source">
210
210
  <pre>
211
- <span class="ruby-comment cmt"># File lib/cachetastic_cacheable.rb, line 84</span>
211
+ <span class="ruby-comment cmt"># File lib/cachetastic/cacheable.rb, line 84</span>
212
212
  84: <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>)
213
213
  85: <span class="ruby-identifier">cache_class</span>.<span class="ruby-identifier">get</span>(<span class="ruby-identifier">key</span>) <span class="ruby-keyword kw">do</span>
214
214
  86: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">block_given?</span>
@@ -222,11 +222,11 @@ Example:
222
222
  </div>
223
223
  </div>
224
224
 
225
- <div id="method-M000051" class="method-detail">
226
- <a name="M000051"></a>
225
+ <div id="method-M000070" class="method-detail">
226
+ <a name="M000070"></a>
227
227
 
228
228
  <div class="method-heading">
229
- <a href="#M000051" class="method-signature">
229
+ <a href="#M000070" class="method-signature">
230
230
  <span class="method-name">expire_all</span><span class="method-args">()</span>
231
231
  </a>
232
232
  </div>
@@ -257,10 +257,10 @@ Example:
257
257
  Person.get_from_cache(1) # =&gt; nil
258
258
  </pre>
259
259
  <p><a class="source-toggle" href="#"
260
- onclick="toggleCode('M000051-source');return false;">[Source]</a></p>
261
- <div class="method-source-code" id="M000051-source">
260
+ onclick="toggleCode('M000070-source');return false;">[Source]</a></p>
261
+ <div class="method-source-code" id="M000070-source">
262
262
  <pre>
263
- <span class="ruby-comment cmt"># File lib/cachetastic_cacheable.rb, line 112</span>
263
+ <span class="ruby-comment cmt"># File lib/cachetastic/cacheable.rb, line 112</span>
264
264
  112: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">expire_all</span>
265
265
  113: <span class="ruby-identifier">cache_class</span>.<span class="ruby-identifier">expire_all</span>
266
266
  114: <span class="ruby-keyword kw">end</span>
@@ -55,8 +55,8 @@
55
55
  <tr class="top-aligned-row">
56
56
  <td><strong>In:</strong></td>
57
57
  <td>
58
- <a href="../../../files/lib/cachetastic_cacheable_rb.html">
59
- lib/cachetastic_cacheable.rb
58
+ <a href="../../../files/lib/cachetastic/cacheable_rb.html">
59
+ lib/cachetastic/cacheable.rb
60
60
  </a>
61
61
  <br />
62
62
  </td>
@@ -80,9 +80,9 @@
80
80
  <h3 class="section-bar">Methods</h3>
81
81
 
82
82
  <div class="name-list">
83
- <a href="#M000053">delete_from_cache</a>&nbsp;&nbsp;
84
- <a href="#M000052">get_from_cache</a>&nbsp;&nbsp;
85
- <a href="#M000054">set_into_cache</a>&nbsp;&nbsp;
83
+ <a href="#M000066">delete_from_cache</a>&nbsp;&nbsp;
84
+ <a href="#M000065">get_from_cache</a>&nbsp;&nbsp;
85
+ <a href="#M000067">set_into_cache</a>&nbsp;&nbsp;
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-M000053" class="method-detail">
108
- <a name="M000053"></a>
107
+ <div id="method-M000066" class="method-detail">
108
+ <a name="M000066"></a>
109
109
 
110
110
  <div class="method-heading">
111
- <a href="#M000053" class="method-signature">
111
+ <a href="#M000066" 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,10 +118,10 @@
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('M000053-source');return false;">[Source]</a></p>
122
- <div class="method-source-code" id="M000053-source">
121
+ onclick="toggleCode('M000066-source');return false;">[Source]</a></p>
122
+ <div class="method-source-code" id="M000066-source">
123
123
  <pre>
124
- <span class="ruby-comment cmt"># File lib/cachetastic_cacheable.rb, line 185</span>
124
+ <span class="ruby-comment cmt"># File lib/cachetastic/cacheable.rb, line 185</span>
125
125
  185: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">delete_from_cache</span>(<span class="ruby-identifier">key</span>)
126
126
  186: <span class="ruby-identifier">cache_class</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-identifier">key</span>)
127
127
  187: <span class="ruby-keyword kw">end</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-M000052" class="method-detail">
134
- <a name="M000052"></a>
133
+ <div id="method-M000065" class="method-detail">
134
+ <a name="M000065"></a>
135
135
 
136
136
  <div class="method-heading">
137
- <a href="#M000052" class="method-signature">
137
+ <a href="#M000065" class="method-signature">
138
138
  <span class="method-name">get_from_cache</span><span class="method-args">(key, &amp;block)</span>
139
139
  </a>
140
140
  </div>
@@ -144,10 +144,10 @@ 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('M000052-source');return false;">[Source]</a></p>
148
- <div class="method-source-code" id="M000052-source">
147
+ onclick="toggleCode('M000065-source');return false;">[Source]</a></p>
148
+ <div class="method-source-code" id="M000065-source">
149
149
  <pre>
150
- <span class="ruby-comment cmt"># File lib/cachetastic_cacheable.rb, line 180</span>
150
+ <span class="ruby-comment cmt"># File lib/cachetastic/cacheable.rb, line 180</span>
151
151
  180: <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">&amp;</span><span class="ruby-identifier">block</span>)
152
152
  181: <span class="ruby-identifier">cache_class</span>.<span class="ruby-identifier">get</span>(<span class="ruby-identifier">key</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
153
153
  182: <span class="ruby-keyword kw">end</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-M000054" class="method-detail">
160
- <a name="M000054"></a>
159
+ <div id="method-M000067" class="method-detail">
160
+ <a name="M000067"></a>
161
161
 
162
162
  <div class="method-heading">
163
- <a href="#M000054" class="method-signature">
163
+ <a href="#M000067" 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,10 +170,10 @@ 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('M000054-source');return false;">[Source]</a></p>
174
- <div class="method-source-code" id="M000054-source">
173
+ onclick="toggleCode('M000067-source');return false;">[Source]</a></p>
174
+ <div class="method-source-code" id="M000067-source">
175
175
  <pre>
176
- <span class="ruby-comment cmt"># File lib/cachetastic_cacheable.rb, line 190</span>
176
+ <span class="ruby-comment cmt"># File lib/cachetastic/cacheable.rb, line 190</span>
177
177
  190: <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>)
178
178
  191: <span class="ruby-identifier">cache_class</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>)
179
179
  192: <span class="ruby-keyword kw">end</span>
@@ -55,8 +55,8 @@
55
55
  <tr class="top-aligned-row">
56
56
  <td><strong>In:</strong></td>
57
57
  <td>
58
- <a href="../../../files/lib/caches/cachetastic_caches_base_rb.html">
59
- lib/caches/cachetastic_caches_base.rb
58
+ <a href="../../../files/lib/cachetastic/caches/base_rb.html">
59
+ lib/cachetastic/caches/base.rb
60
60
  </a>
61
61
  <br />
62
62
  </td>
@@ -120,21 +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="#M000064">adapter</a>&nbsp;&nbsp;
124
- <a href="#M000067">adapter_supported?</a>&nbsp;&nbsp;
125
- <a href="#M000056">all_registered_caches</a>&nbsp;&nbsp;
126
- <a href="#M000063">cache_name</a>&nbsp;&nbsp;
127
- <a href="#M000070">calculate_expiry_time</a>&nbsp;&nbsp;
128
- <a href="#M000059">delete</a>&nbsp;&nbsp;
129
- <a href="#M000060">expire_all</a>&nbsp;&nbsp;
130
- <a href="#M000057">get</a>&nbsp;&nbsp;
131
- <a href="#M000065">logger</a>&nbsp;&nbsp;
132
- <a href="#M000068">marshall</a>&nbsp;&nbsp;
133
- <a href="#M000061">populate_all</a>&nbsp;&nbsp;
134
- <a href="#M000058">set</a>&nbsp;&nbsp;
135
- <a href="#M000062">stats</a>&nbsp;&nbsp;
136
- <a href="#M000069">unmarshall</a>&nbsp;&nbsp;
137
- <a href="#M000066">unsupported_adapters</a>&nbsp;&nbsp;
123
+ <a href="#M000055">adapter</a>&nbsp;&nbsp;
124
+ <a href="#M000058">adapter_supported?</a>&nbsp;&nbsp;
125
+ <a href="#M000048">all_registered_caches</a>&nbsp;&nbsp;
126
+ <a href="#M000054">cache_name</a>&nbsp;&nbsp;
127
+ <a href="#M000061">calculate_expiry_time</a>&nbsp;&nbsp;
128
+ <a href="#M000051">delete</a>&nbsp;&nbsp;
129
+ <a href="#M000052">expire_all</a>&nbsp;&nbsp;
130
+ <a href="#M000049">get</a>&nbsp;&nbsp;
131
+ <a href="#M000056">logger</a>&nbsp;&nbsp;
132
+ <a href="#M000059">marshall</a>&nbsp;&nbsp;
133
+ <a href="#M000050">set</a>&nbsp;&nbsp;
134
+ <a href="#M000053">stats</a>&nbsp;&nbsp;
135
+ <a href="#M000060">unmarshall</a>&nbsp;&nbsp;
136
+ <a href="#M000057">unsupported_adapters</a>&nbsp;&nbsp;
138
137
  </div>
139
138
  </div>
140
139
 
@@ -175,11 +174,11 @@ different for your cache.
175
174
  <div id="methods">
176
175
  <h3 class="section-bar">Public Class methods</h3>
177
176
 
178
- <div id="method-M000064" class="method-detail">
179
- <a name="M000064"></a>
177
+ <div id="method-M000055" class="method-detail">
178
+ <a name="M000055"></a>
180
179
 
181
180
  <div class="method-heading">
182
- <a href="#M000064" class="method-signature">
181
+ <a href="#M000055" class="method-signature">
183
182
  <span class="method-name">adapter</span><span class="method-args">()</span>
184
183
  </a>
185
184
  </div>
@@ -191,55 +190,55 @@ href="../Adapters/Base.html">Cachetastic::Adapters::Base</a> for this
191
190
  cache.
192
191
  </p>
193
192
  <p><a class="source-toggle" href="#"
194
- onclick="toggleCode('M000064-source');return false;">[Source]</a></p>
195
- <div class="method-source-code" id="M000064-source">
193
+ onclick="toggleCode('M000055-source');return false;">[Source]</a></p>
194
+ <div class="method-source-code" id="M000055-source">
196
195
  <pre>
197
- <span class="ruby-comment cmt"># File lib/caches/cachetastic_caches_base.rb, line 141</span>
198
- 141: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">adapter</span>
199
- 142: <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>)
200
- 143: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">adapter_supported?</span>(<span class="ruby-identifier">a</span>.<span class="ruby-identifier">class</span>)
201
- 144: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">a</span>
202
- 145: <span class="ruby-keyword kw">else</span>
203
- 146: <span class="ruby-identifier">raise</span> <span class="ruby-constant">Cachetastic</span><span class="ruby-operator">::</span><span class="ruby-constant">Errors</span><span class="ruby-operator">::</span><span class="ruby-constant">UnsupportedAdapter</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">cache_name</span>, <span class="ruby-identifier">a</span>.<span class="ruby-identifier">class</span>)
204
- 147: <span class="ruby-keyword kw">end</span>
205
- 148: <span class="ruby-keyword kw">end</span>
196
+ <span class="ruby-comment cmt"># File lib/cachetastic/caches/base.rb, line 139</span>
197
+ 139: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">adapter</span>
198
+ 140: <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>)
199
+ 141: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">adapter_supported?</span>(<span class="ruby-identifier">a</span>.<span class="ruby-identifier">class</span>)
200
+ 142: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">a</span>
201
+ 143: <span class="ruby-keyword kw">else</span>
202
+ 144: <span class="ruby-identifier">raise</span> <span class="ruby-constant">Cachetastic</span><span class="ruby-operator">::</span><span class="ruby-constant">Errors</span><span class="ruby-operator">::</span><span class="ruby-constant">UnsupportedAdapter</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">cache_name</span>, <span class="ruby-identifier">a</span>.<span class="ruby-identifier">class</span>)
203
+ 145: <span class="ruby-keyword kw">end</span>
204
+ 146: <span class="ruby-keyword kw">end</span>
206
205
  </pre>
207
206
  </div>
208
207
  </div>
209
208
  </div>
210
209
 
211
- <div id="method-M000067" class="method-detail">
212
- <a name="M000067"></a>
210
+ <div id="method-M000058" class="method-detail">
211
+ <a name="M000058"></a>
213
212
 
214
213
  <div class="method-heading">
215
- <a href="#M000067" class="method-signature">
214
+ <a href="#M000058" class="method-signature">
216
215
  <span class="method-name">adapter_supported?</span><span class="method-args">(a = cache_conn_instance.get(cache_name).class)</span>
217
216
  </a>
218
217
  </div>
219
218
 
220
219
  <div class="method-description">
221
220
  <p>
222
- Returns true/false on whether the <a href="Base.html#M000064">adapter</a>
221
+ Returns true/false on whether the <a href="Base.html#M000055">adapter</a>
223
222
  you want to use is supported for the cache.
224
223
  </p>
225
224
  <p><a class="source-toggle" href="#"
226
- onclick="toggleCode('M000067-source');return false;">[Source]</a></p>
227
- <div class="method-source-code" id="M000067-source">
225
+ onclick="toggleCode('M000058-source');return false;">[Source]</a></p>
226
+ <div class="method-source-code" id="M000058-source">
228
227
  <pre>
229
- <span class="ruby-comment cmt"># File lib/caches/cachetastic_caches_base.rb, line 163</span>
230
- 163: <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>)
231
- 164: <span class="ruby-keyword kw">return</span> <span class="ruby-operator">!</span><span class="ruby-identifier">unsupported_adapters</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">a</span>)
232
- 165: <span class="ruby-keyword kw">end</span>
228
+ <span class="ruby-comment cmt"># File lib/cachetastic/caches/base.rb, line 161</span>
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>)
230
+ 162: <span class="ruby-keyword kw">return</span> <span class="ruby-operator">!</span><span class="ruby-identifier">unsupported_adapters</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">a</span>)
231
+ 163: <span class="ruby-keyword kw">end</span>
233
232
  </pre>
234
233
  </div>
235
234
  </div>
236
235
  </div>
237
236
 
238
- <div id="method-M000056" class="method-detail">
239
- <a name="M000056"></a>
237
+ <div id="method-M000048" class="method-detail">
238
+ <a name="M000048"></a>
240
239
 
241
240
  <div class="method-heading">
242
- <a href="#M000056" class="method-signature">
241
+ <a href="#M000048" class="method-signature">
243
242
  <span class="method-name">all_registered_caches</span><span class="method-args">()</span>
244
243
  </a>
245
244
  </div>
@@ -249,10 +248,10 @@ you want to use is supported for the cache.
249
248
  Returns a list of all registered caches in the system.
250
249
  </p>
251
250
  <p><a class="source-toggle" href="#"
252
- onclick="toggleCode('M000056-source');return false;">[Source]</a></p>
253
- <div class="method-source-code" id="M000056-source">
251
+ onclick="toggleCode('M000048-source');return false;">[Source]</a></p>
252
+ <div class="method-source-code" id="M000048-source">
254
253
  <pre>
255
- <span class="ruby-comment cmt"># File lib/caches/cachetastic_caches_base.rb, line 48</span>
254
+ <span class="ruby-comment cmt"># File lib/cachetastic/caches/base.rb, line 48</span>
256
255
  48: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">all_registered_caches</span>
257
256
  49: <span class="ruby-constant">RegisteredCaches</span>.<span class="ruby-identifier">instance</span>.<span class="ruby-identifier">list</span>
258
257
  50: <span class="ruby-keyword kw">end</span>
@@ -261,11 +260,11 @@ Returns a list of all registered caches in the system.
261
260
  </div>
262
261
  </div>
263
262
 
264
- <div id="method-M000063" class="method-detail">
265
- <a name="M000063"></a>
263
+ <div id="method-M000054" class="method-detail">
264
+ <a name="M000054"></a>
266
265
 
267
266
  <div class="method-heading">
268
- <a href="#M000063" class="method-signature">
267
+ <a href="#M000054" class="method-signature">
269
268
  <span class="method-name">cache_name</span><span class="method-args">()</span>
270
269
  </a>
271
270
  </div>
@@ -281,23 +280,23 @@ href="../Connection.html">Cachetastic::Connection</a> class.
281
280
  Cachetastic::Caches::Base # =&gt; &quot;cachetastic_caches_base&quot;
282
281
  </pre>
283
282
  <p><a class="source-toggle" href="#"
284
- onclick="toggleCode('M000063-source');return false;">[Source]</a></p>
285
- <div class="method-source-code" id="M000063-source">
283
+ onclick="toggleCode('M000054-source');return false;">[Source]</a></p>
284
+ <div class="method-source-code" id="M000054-source">
286
285
  <pre>
287
- <span class="ruby-comment cmt"># File lib/caches/cachetastic_caches_base.rb, line 136</span>
288
- 136: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">cache_name</span>
289
- 137: <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">name</span>.<span class="ruby-identifier">methodize</span>
290
- 138: <span class="ruby-keyword kw">end</span>
286
+ <span class="ruby-comment cmt"># File lib/cachetastic/caches/base.rb, line 134</span>
287
+ 134: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">cache_name</span>
288
+ 135: <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">name</span>.<span class="ruby-identifier">methodize</span>
289
+ 136: <span class="ruby-keyword kw">end</span>
291
290
  </pre>
292
291
  </div>
293
292
  </div>
294
293
  </div>
295
294
 
296
- <div id="method-M000059" class="method-detail">
297
- <a name="M000059"></a>
295
+ <div id="method-M000051" class="method-detail">
296
+ <a name="M000051"></a>
298
297
 
299
298
  <div class="method-heading">
300
- <a href="#M000059" class="method-signature">
299
+ <a href="#M000051" class="method-signature">
301
300
  <span class="method-name">delete</span><span class="method-args">(key, delay = 0)</span>
302
301
  </a>
303
302
  </div>
@@ -306,14 +305,14 @@ href="../Connection.html">Cachetastic::Connection</a> class.
306
305
  <p>
307
306
  Deletes an object from the cache. The optional delay parameter sets an
308
307
  offset, in seconds, for when the object should <a
309
- href="Base.html#M000057">get</a> deleted. The default of 0 means the object
308
+ href="Base.html#M000049">get</a> deleted. The default of 0 means the object
310
309
  gets deleted right away.
311
310
  </p>
312
311
  <p><a class="source-toggle" href="#"
313
- onclick="toggleCode('M000059-source');return false;">[Source]</a></p>
314
- <div class="method-source-code" id="M000059-source">
312
+ onclick="toggleCode('M000051-source');return false;">[Source]</a></p>
313
+ <div class="method-source-code" id="M000051-source">
315
314
  <pre>
316
- <span class="ruby-comment cmt"># File lib/caches/cachetastic_caches_base.rb, line 108</span>
315
+ <span class="ruby-comment cmt"># File lib/cachetastic/caches/base.rb, line 108</span>
317
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>)
318
317
  109: <span class="ruby-identifier">do_with_logging</span>(<span class="ruby-identifier">:delete</span>, <span class="ruby-identifier">key</span>) <span class="ruby-keyword kw">do</span>
319
318
  110: <span class="ruby-identifier">adapter</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-identifier">key</span>.<span class="ruby-identifier">to_s</span>, <span class="ruby-identifier">delay</span>)
@@ -324,11 +323,11 @@ gets deleted right away.
324
323
  </div>
325
324
  </div>
326
325
 
327
- <div id="method-M000060" class="method-detail">
328
- <a name="M000060"></a>
326
+ <div id="method-M000052" class="method-detail">
327
+ <a name="M000052"></a>
329
328
 
330
329
  <div class="method-heading">
331
- <a href="#M000060" class="method-signature">
330
+ <a href="#M000052" class="method-signature">
332
331
  <span class="method-name">expire_all</span><span class="method-args">()</span>
333
332
  </a>
334
333
  </div>
@@ -338,10 +337,10 @@ gets deleted right away.
338
337
  Expires all objects for this cache.
339
338
  </p>
340
339
  <p><a class="source-toggle" href="#"
341
- onclick="toggleCode('M000060-source');return false;">[Source]</a></p>
342
- <div class="method-source-code" id="M000060-source">
340
+ onclick="toggleCode('M000052-source');return false;">[Source]</a></p>
341
+ <div class="method-source-code" id="M000052-source">
343
342
  <pre>
344
- <span class="ruby-comment cmt"># File lib/caches/cachetastic_caches_base.rb, line 115</span>
343
+ <span class="ruby-comment cmt"># File lib/cachetastic/caches/base.rb, line 115</span>
345
344
  115: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">expire_all</span>
346
345
  116: <span class="ruby-identifier">adapter</span>.<span class="ruby-identifier">expire_all</span>
347
346
  117: <span class="ruby-identifier">logger</span>.<span class="ruby-identifier">info</span>(<span class="ruby-value str">''</span>, <span class="ruby-value str">''</span>, <span class="ruby-identifier">:expired</span>, <span class="ruby-identifier">cache_name</span>)
@@ -351,11 +350,11 @@ Expires all objects for this cache.
351
350
  </div>
352
351
  </div>
353
352
 
354
- <div id="method-M000057" class="method-detail">
355
- <a name="M000057"></a>
353
+ <div id="method-M000049" class="method-detail">
354
+ <a name="M000049"></a>
356
355
 
357
356
  <div class="method-heading">
358
- <a href="#M000057" class="method-signature">
357
+ <a href="#M000049" class="method-signature">
359
358
  <span class="method-name">get</span><span class="method-args">(key) {|key if block_given?| ...}</span>
360
359
  </a>
361
360
  </div>
@@ -365,14 +364,14 @@ Expires all objects for this cache.
365
364
  Returns an object from the cache for a given key. If the object comes back
366
365
  as nil and a block is given that block will be run and the results of the
367
366
  block will be run. This can be used to JIT caches, just make sure in the
368
- block to call the <a href="Base.html#M000058">set</a> method because the
367
+ block to call the <a href="Base.html#M000050">set</a> method because the
369
368
  results of the block are not automatically cached.
370
369
  </p>
371
370
  <p><a class="source-toggle" href="#"
372
- onclick="toggleCode('M000057-source');return false;">[Source]</a></p>
373
- <div class="method-source-code" id="M000057-source">
371
+ onclick="toggleCode('M000049-source');return false;">[Source]</a></p>
372
+ <div class="method-source-code" id="M000049-source">
374
373
  <pre>
375
- <span class="ruby-comment cmt"># File lib/caches/cachetastic_caches_base.rb, line 58</span>
374
+ <span class="ruby-comment cmt"># File lib/cachetastic/caches/base.rb, line 58</span>
376
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">&amp;</span><span class="ruby-identifier">block</span>)
377
376
  59: <span class="ruby-identifier">res</span> = <span class="ruby-keyword kw">nil</span>
378
377
  60: <span class="ruby-identifier">do_with_logging</span>(<span class="ruby-identifier">:get</span>, <span class="ruby-identifier">key</span>) <span class="ruby-keyword kw">do</span>
@@ -406,11 +405,11 @@ results of the block are not automatically cached.
406
405
  </div>
407
406
  </div>
408
407
 
409
- <div id="method-M000065" class="method-detail">
410
- <a name="M000065"></a>
408
+ <div id="method-M000056" class="method-detail">
409
+ <a name="M000056"></a>
411
410
 
412
411
  <div class="method-heading">
413
- <a href="#M000065" class="method-signature">
412
+ <a href="#M000056" class="method-signature">
414
413
  <span class="method-name">logger</span><span class="method-args">()</span>
415
414
  </a>
416
415
  </div>
@@ -421,83 +420,55 @@ Returns the <a href="../Logger.html">Cachetastic::Logger</a> for the
421
420
  underlying <a href="../Adapters/Base.html">Cachetastic::Adapters::Base</a>.
422
421
  </p>
423
422
  <p><a class="source-toggle" href="#"
424
- onclick="toggleCode('M000065-source');return false;">[Source]</a></p>
425
- <div class="method-source-code" id="M000065-source">
423
+ onclick="toggleCode('M000056-source');return false;">[Source]</a></p>
424
+ <div class="method-source-code" id="M000056-source">
426
425
  <pre>
427
- <span class="ruby-comment cmt"># File lib/caches/cachetastic_caches_base.rb, line 151</span>
428
- 151: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">logger</span>
429
- 152: <span class="ruby-identifier">adapter</span>.<span class="ruby-identifier">logger</span>
430
- 153: <span class="ruby-keyword kw">end</span>
426
+ <span class="ruby-comment cmt"># File lib/cachetastic/caches/base.rb, line 149</span>
427
+ 149: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">logger</span>
428
+ 150: <span class="ruby-identifier">adapter</span>.<span class="ruby-identifier">logger</span>
429
+ 151: <span class="ruby-keyword kw">end</span>
431
430
  </pre>
432
431
  </div>
433
432
  </div>
434
433
  </div>
435
434
 
436
- <div id="method-M000068" class="method-detail">
437
- <a name="M000068"></a>
435
+ <div id="method-M000059" class="method-detail">
436
+ <a name="M000059"></a>
438
437
 
439
438
  <div class="method-heading">
440
- <a href="#M000068" class="method-signature">
439
+ <a href="#M000059" class="method-signature">
441
440
  <span class="method-name">marshall</span><span class="method-args">(value)</span>
442
441
  </a>
443
442
  </div>
444
443
 
445
444
  <div class="method-description">
446
445
  <p><a class="source-toggle" href="#"
447
- onclick="toggleCode('M000068-source');return false;">[Source]</a></p>
448
- <div class="method-source-code" id="M000068-source">
449
- <pre>
450
- <span class="ruby-comment cmt"># File lib/caches/cachetastic_caches_base.rb, line 167</span>
451
- 167: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">marshall</span>(<span class="ruby-identifier">value</span>)
452
- 168: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">value</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">value</span>.<span class="ruby-identifier">nil?</span>
453
- 169: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">case</span> <span class="ruby-identifier">adapter</span>.<span class="ruby-identifier">all_options</span>[<span class="ruby-value str">&quot;marshall_method&quot;</span>]
454
- 170: <span class="ruby-keyword kw">when</span> <span class="ruby-value str">&quot;yaml&quot;</span>
455
- 171: <span class="ruby-constant">YAML</span>.<span class="ruby-identifier">dump</span>(<span class="ruby-identifier">value</span>)
456
- 172: <span class="ruby-keyword kw">when</span> <span class="ruby-value str">&quot;ruby&quot;</span>
457
- 173: <span class="ruby-constant">Marshal</span>.<span class="ruby-identifier">dump</span>(<span class="ruby-identifier">value</span>)
458
- 174: <span class="ruby-keyword kw">else</span>
459
- 175: <span class="ruby-identifier">value</span>
460
- 176: <span class="ruby-keyword kw">end</span>
461
- 177: <span class="ruby-keyword kw">end</span>
462
- </pre>
463
- </div>
464
- </div>
465
- </div>
466
-
467
- <div id="method-M000061" class="method-detail">
468
- <a name="M000061"></a>
469
-
470
- <div class="method-heading">
471
- <a href="#M000061" class="method-signature">
472
- <span class="method-name">populate_all</span><span class="method-args">()</span>
473
- </a>
474
- </div>
475
-
476
- <div class="method-description">
477
- <p>
478
- Raises a MethodNotImplemented exception. This method should be overridden
479
- in the child class to enable a populating the cache with all things that
480
- should be in there.
481
- </p>
482
- <p><a class="source-toggle" href="#"
483
- onclick="toggleCode('M000061-source');return false;">[Source]</a></p>
484
- <div class="method-source-code" id="M000061-source">
446
+ onclick="toggleCode('M000059-source');return false;">[Source]</a></p>
447
+ <div class="method-source-code" id="M000059-source">
485
448
  <pre>
486
- <span class="ruby-comment cmt"># File lib/caches/cachetastic_caches_base.rb, line 123</span>
487
- 123: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">populate_all</span>
488
- 124: <span class="ruby-identifier">raise</span> <span class="ruby-constant">MethodNotImplemented</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value str">&quot;populate_all&quot;</span>)
489
- 125: <span class="ruby-keyword kw">end</span>
449
+ <span class="ruby-comment cmt"># File lib/cachetastic/caches/base.rb, line 165</span>
450
+ 165: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">marshall</span>(<span class="ruby-identifier">value</span>)
451
+ 166: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">value</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">value</span>.<span class="ruby-identifier">nil?</span>
452
+ 167: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">case</span> <span class="ruby-identifier">adapter</span>.<span class="ruby-identifier">configuration</span>.<span class="ruby-identifier">retrieve</span>(<span class="ruby-identifier">:marshall_method</span>, <span class="ruby-identifier">:none</span>).<span class="ruby-identifier">to_sym</span>
453
+ 168: <span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:yaml</span>
454
+ 169: <span class="ruby-constant">YAML</span>.<span class="ruby-identifier">dump</span>(<span class="ruby-identifier">value</span>)
455
+ 170: <span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:ruby</span>
456
+ 171: <span class="ruby-constant">Marshal</span>.<span class="ruby-identifier">dump</span>(<span class="ruby-identifier">value</span>)
457
+ 172: <span class="ruby-keyword kw">else</span>
458
+ 173: <span class="ruby-identifier">value</span>
459
+ 174: <span class="ruby-keyword kw">end</span>
460
+ 175: <span class="ruby-keyword kw">end</span>
490
461
  </pre>
491
462
  </div>
492
463
  </div>
493
464
  </div>
494
465
 
495
- <div id="method-M000058" class="method-detail">
496
- <a name="M000058"></a>
466
+ <div id="method-M000050" class="method-detail">
467
+ <a name="M000050"></a>
497
468
 
498
469
  <div class="method-heading">
499
- <a href="#M000058" class="method-signature">
500
- <span class="method-name">set</span><span class="method-args">(key, value, expiry = (adapter.all_options[&quot;default_expiry&quot;] || 0))</span>
470
+ <a href="#M000050" class="method-signature">
471
+ <span class="method-name">set</span><span class="method-args">(key, value, expiry = adapter.configuration.retrieve(:default_expiry, 0))</span>
501
472
  </a>
502
473
  </div>
503
474
 
@@ -505,19 +476,19 @@ should be in there.
505
476
  <p>
506
477
  Set a particular object info the cache for the given key. An optional third
507
478
  parameter sets the expiry time for the object in the cache. The default for
508
- this expiry is <a href="Base.html#M000058">set</a> as either 0, meaning it
479
+ this expiry is <a href="Base.html#M000050">set</a> as either 0, meaning it
509
480
  never expires, or if there&#8216;s a default_expiry time <a
510
- href="Base.html#M000058">set</a> in the config file, that file will be
511
- used. If there is an expiry_swing <a href="Base.html#M000058">set</a> in
481
+ href="Base.html#M000050">set</a> in the config file, that file will be
482
+ used. If there is an expiry_swing <a href="Base.html#M000050">set</a> in
512
483
  the config file it will be +/- to the expiry time. See also: <a
513
- href="Base.html#M000070">calculate_expiry_time</a>
484
+ href="Base.html#M000061">calculate_expiry_time</a>
514
485
  </p>
515
486
  <p><a class="source-toggle" href="#"
516
- onclick="toggleCode('M000058-source');return false;">[Source]</a></p>
517
- <div class="method-source-code" id="M000058-source">
487
+ onclick="toggleCode('M000050-source');return false;">[Source]</a></p>
488
+ <div class="method-source-code" id="M000050-source">
518
489
  <pre>
519
- <span class="ruby-comment cmt"># File lib/caches/cachetastic_caches_base.rb, line 94</span>
520
- 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">all_options</span>[<span class="ruby-value str">&quot;default_expiry&quot;</span>] <span class="ruby-operator">||</span> <span class="ruby-value">0</span>))
490
+ <span class="ruby-comment cmt"># File lib/cachetastic/caches/base.rb, line 94</span>
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>))
521
492
  95: <span class="ruby-identifier">do_with_logging</span>(<span class="ruby-identifier">:set</span>, <span class="ruby-identifier">key</span>) <span class="ruby-keyword kw">do</span>
522
493
  96: <span class="ruby-identifier">expiry</span> = <span class="ruby-identifier">calculate_expiry_time</span>(<span class="ruby-identifier">expiry</span>)
523
494
  97: <span class="ruby-identifier">adapter</span>.<span class="ruby-identifier">set</span>(<span class="ruby-identifier">key</span>.<span class="ruby-identifier">to_s</span>, <span class="ruby-identifier">marshall</span>(<span class="ruby-identifier">value</span>), <span class="ruby-identifier">expiry</span>.<span class="ruby-identifier">to_i</span>)
@@ -530,11 +501,11 @@ href="Base.html#M000070">calculate_expiry_time</a>
530
501
  </div>
531
502
  </div>
532
503
 
533
- <div id="method-M000062" class="method-detail">
534
- <a name="M000062"></a>
504
+ <div id="method-M000053" class="method-detail">
505
+ <a name="M000053"></a>
535
506
 
536
507
  <div class="method-heading">
537
- <a href="#M000062" class="method-signature">
508
+ <a href="#M000053" class="method-signature">
538
509
  <span class="method-name">stats</span><span class="method-args">()</span>
539
510
  </a>
540
511
  </div>
@@ -545,54 +516,54 @@ A convenience method that returns statistics for the underlying <a
545
516
  href="../Adapters/Base.html">Cachetastic::Adapters::Base</a> for the cache.
546
517
  </p>
547
518
  <p><a class="source-toggle" href="#"
548
- onclick="toggleCode('M000062-source');return false;">[Source]</a></p>
549
- <div class="method-source-code" id="M000062-source">
519
+ onclick="toggleCode('M000053-source');return false;">[Source]</a></p>
520
+ <div class="method-source-code" id="M000053-source">
550
521
  <pre>
551
- <span class="ruby-comment cmt"># File lib/caches/cachetastic_caches_base.rb, line 128</span>
552
- 128: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">stats</span>
553
- 129: <span class="ruby-identifier">adapter</span>.<span class="ruby-identifier">stats</span>
554
- 130: <span class="ruby-keyword kw">end</span>
522
+ <span class="ruby-comment cmt"># File lib/cachetastic/caches/base.rb, line 126</span>
523
+ 126: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">stats</span>
524
+ 127: <span class="ruby-identifier">adapter</span>.<span class="ruby-identifier">stats</span>
525
+ 128: <span class="ruby-keyword kw">end</span>
555
526
  </pre>
556
527
  </div>
557
528
  </div>
558
529
  </div>
559
530
 
560
- <div id="method-M000069" class="method-detail">
561
- <a name="M000069"></a>
531
+ <div id="method-M000060" class="method-detail">
532
+ <a name="M000060"></a>
562
533
 
563
534
  <div class="method-heading">
564
- <a href="#M000069" class="method-signature">
535
+ <a href="#M000060" class="method-signature">
565
536
  <span class="method-name">unmarshall</span><span class="method-args">(value)</span>
566
537
  </a>
567
538
  </div>
568
539
 
569
540
  <div class="method-description">
570
541
  <p><a class="source-toggle" href="#"
571
- onclick="toggleCode('M000069-source');return false;">[Source]</a></p>
572
- <div class="method-source-code" id="M000069-source">
542
+ onclick="toggleCode('M000060-source');return false;">[Source]</a></p>
543
+ <div class="method-source-code" id="M000060-source">
573
544
  <pre>
574
- <span class="ruby-comment cmt"># File lib/caches/cachetastic_caches_base.rb, line 179</span>
575
- 179: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">unmarshall</span>(<span class="ruby-identifier">value</span>)
576
- 180: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">value</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">value</span>.<span class="ruby-identifier">nil?</span>
577
- 181: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">case</span> <span class="ruby-identifier">adapter</span>.<span class="ruby-identifier">all_options</span>[<span class="ruby-value str">&quot;marshall_method&quot;</span>]
578
- 182: <span class="ruby-keyword kw">when</span> <span class="ruby-value str">&quot;yaml&quot;</span>
579
- 183: <span class="ruby-constant">YAML</span>.<span class="ruby-identifier">load</span>(<span class="ruby-identifier">value</span>)
580
- 184: <span class="ruby-keyword kw">when</span> <span class="ruby-value str">&quot;ruby&quot;</span>
581
- 185: <span class="ruby-constant">Marshal</span>.<span class="ruby-identifier">load</span>(<span class="ruby-identifier">value</span>)
582
- 186: <span class="ruby-keyword kw">else</span>
583
- 187: <span class="ruby-identifier">value</span>
584
- 188: <span class="ruby-keyword kw">end</span>
585
- 189: <span class="ruby-keyword kw">end</span>
545
+ <span class="ruby-comment cmt"># File lib/cachetastic/caches/base.rb, line 177</span>
546
+ 177: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">unmarshall</span>(<span class="ruby-identifier">value</span>)
547
+ 178: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">value</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">value</span>.<span class="ruby-identifier">nil?</span>
548
+ 179: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">case</span> <span class="ruby-identifier">adapter</span>.<span class="ruby-identifier">configuration</span>.<span class="ruby-identifier">retrieve</span>(<span class="ruby-identifier">:marshall_method</span>, <span class="ruby-identifier">:none</span>).<span class="ruby-identifier">to_sym</span>
549
+ 180: <span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:yaml</span>
550
+ 181: <span class="ruby-constant">YAML</span>.<span class="ruby-identifier">load</span>(<span class="ruby-identifier">value</span>)
551
+ 182: <span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:ruby</span>
552
+ 183: <span class="ruby-constant">Marshal</span>.<span class="ruby-identifier">load</span>(<span class="ruby-identifier">value</span>)
553
+ 184: <span class="ruby-keyword kw">else</span>
554
+ 185: <span class="ruby-identifier">value</span>
555
+ 186: <span class="ruby-keyword kw">end</span>
556
+ 187: <span class="ruby-keyword kw">end</span>
586
557
  </pre>
587
558
  </div>
588
559
  </div>
589
560
  </div>
590
561
 
591
- <div id="method-M000066" class="method-detail">
592
- <a name="M000066"></a>
562
+ <div id="method-M000057" class="method-detail">
563
+ <a name="M000057"></a>
593
564
 
594
565
  <div class="method-heading">
595
- <a href="#M000066" class="method-signature">
566
+ <a href="#M000057" class="method-signature">
596
567
  <span class="method-name">unsupported_adapters</span><span class="method-args">()</span>
597
568
  </a>
598
569
  </div>
@@ -600,18 +571,18 @@ href="../Adapters/Base.html">Cachetastic::Adapters::Base</a> for the cache.
600
571
  <div class="method-description">
601
572
  <p>
602
573
  Returns an array of unsupported adapters for this cache. Defaults to an
603
- empty array which will let any <a href="Base.html#M000064">adapter</a> be
574
+ empty array which will let any <a href="Base.html#M000055">adapter</a> be
604
575
  used by the cache. Override in your specific cache to prevent certain
605
576
  adapters.
606
577
  </p>
607
578
  <p><a class="source-toggle" href="#"
608
- onclick="toggleCode('M000066-source');return false;">[Source]</a></p>
609
- <div class="method-source-code" id="M000066-source">
579
+ onclick="toggleCode('M000057-source');return false;">[Source]</a></p>
580
+ <div class="method-source-code" id="M000057-source">
610
581
  <pre>
611
- <span class="ruby-comment cmt"># File lib/caches/cachetastic_caches_base.rb, line 158</span>
612
- 158: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">unsupported_adapters</span>
613
- 159: []
614
- 160: <span class="ruby-keyword kw">end</span>
582
+ <span class="ruby-comment cmt"># File lib/cachetastic/caches/base.rb, line 156</span>
583
+ 156: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">unsupported_adapters</span>
584
+ 157: []
585
+ 158: <span class="ruby-keyword kw">end</span>
615
586
  </pre>
616
587
  </div>
617
588
  </div>
@@ -619,39 +590,39 @@ adapters.
619
590
 
620
591
  <h3 class="section-bar">Private Class methods</h3>
621
592
 
622
- <div id="method-M000070" class="method-detail">
623
- <a name="M000070"></a>
593
+ <div id="method-M000061" class="method-detail">
594
+ <a name="M000061"></a>
624
595
 
625
596
  <div class="method-heading">
626
- <a href="#M000070" class="method-signature">
597
+ <a href="#M000061" class="method-signature">
627
598
  <span class="method-name">calculate_expiry_time</span><span class="method-args">(expiry)</span>
628
599
  </a>
629
600
  </div>
630
601
 
631
602
  <div class="method-description">
632
603
  <p>
633
- If the expiry time is <a href="Base.html#M000058">set</a> to 60 minutes and
634
- the expiry_swing time is <a href="Base.html#M000058">set</a> to 15 minutes,
604
+ If the expiry time is <a href="Base.html#M000050">set</a> to 60 minutes and
605
+ the expiry_swing time is <a href="Base.html#M000050">set</a> to 15 minutes,
635
606
  this method will return a number between 45 minutes and 75 minutes.
636
607
  </p>
637
608
  <p><a class="source-toggle" href="#"
638
- onclick="toggleCode('M000070-source');return false;">[Source]</a></p>
639
- <div class="method-source-code" id="M000070-source">
609
+ onclick="toggleCode('M000061-source');return false;">[Source]</a></p>
610
+ <div class="method-source-code" id="M000061-source">
640
611
  <pre>
641
- <span class="ruby-comment cmt"># File lib/caches/cachetastic_caches_base.rb, line 194</span>
642
- 194: <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>
643
- 195: <span class="ruby-identifier">exp_swing</span> = <span class="ruby-identifier">adapter</span>.<span class="ruby-identifier">all_options</span>[<span class="ruby-value str">&quot;expiry_swing&quot;</span>]
644
- 196: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">exp_swing</span>
645
- 197: <span class="ruby-identifier">swing</span> = <span class="ruby-identifier">rand</span>(<span class="ruby-identifier">exp_swing</span>.<span class="ruby-identifier">to_i</span>)
646
- 198: <span class="ruby-keyword kw">case</span> <span class="ruby-identifier">rand</span>(<span class="ruby-value">2</span>)
647
- 199: <span class="ruby-keyword kw">when</span> <span class="ruby-value">0</span>
648
- 200: <span class="ruby-identifier">expiry</span> = (<span class="ruby-identifier">expiry</span>.<span class="ruby-identifier">to_i</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">swing</span>)
649
- 201: <span class="ruby-keyword kw">when</span> <span class="ruby-value">1</span>
650
- 202: <span class="ruby-identifier">expiry</span> = (<span class="ruby-identifier">expiry</span>.<span class="ruby-identifier">to_i</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">swing</span>)
651
- 203: <span class="ruby-keyword kw">end</span>
652
- 204: <span class="ruby-keyword kw">end</span>
653
- 205: <span class="ruby-identifier">expiry</span>
654
- 206: <span class="ruby-keyword kw">end</span>
612
+ <span class="ruby-comment cmt"># File lib/cachetastic/caches/base.rb, line 192</span>
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>
614
+ 193: <span class="ruby-identifier">exp_swing</span> = <span class="ruby-identifier">adapter</span>.<span class="ruby-identifier">configuration</span>.<span class="ruby-identifier">retrieve</span>(<span class="ruby-identifier">:expiry_swing</span>, <span class="ruby-value">0</span>)
615
+ 194: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">exp_swing</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">exp_swing</span> <span class="ruby-operator">!=</span> <span class="ruby-value">0</span>
616
+ 195: <span class="ruby-identifier">swing</span> = <span class="ruby-identifier">rand</span>(<span class="ruby-identifier">exp_swing</span>.<span class="ruby-identifier">to_i</span>)
617
+ 196: <span class="ruby-keyword kw">case</span> <span class="ruby-identifier">rand</span>(<span class="ruby-value">2</span>)
618
+ 197: <span class="ruby-keyword kw">when</span> <span class="ruby-value">0</span>
619
+ 198: <span class="ruby-identifier">expiry</span> = (<span class="ruby-identifier">expiry</span>.<span class="ruby-identifier">to_i</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">swing</span>)
620
+ 199: <span class="ruby-keyword kw">when</span> <span class="ruby-value">1</span>
621
+ 200: <span class="ruby-identifier">expiry</span> = (<span class="ruby-identifier">expiry</span>.<span class="ruby-identifier">to_i</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">swing</span>)
622
+ 201: <span class="ruby-keyword kw">end</span>
623
+ 202: <span class="ruby-keyword kw">end</span>
624
+ 203: <span class="ruby-identifier">expiry</span>
625
+ 204: <span class="ruby-keyword kw">end</span>
655
626
  </pre>
656
627
  </div>
657
628
  </div>