Module: Pione::System::FileCache
- Defined in:
- lib/pione/system/file-cache.rb
Overview
FileCache is a caching system for task workers.
Defined Under Namespace
Classes: FileCacheMethod, SimpleCacheMethod
Class Method Summary collapse
-
.cache_method ⇒ Class
Returns file cache class.
-
.get(uri) ⇒ String
Gets cached data path from the uri resource.
-
.instance ⇒ CacheMethod
Returns the singleton.
-
.put(src, uri) ⇒ Object
Puts the data to uri resource and caches it.
-
.set_cache_method(klass) ⇒ void
Sets a file cache class.
-
.shift(old_uri, new_uri) ⇒ void
Shifts the resource from old uri to new uri.
Class Method Details
.cache_method ⇒ Class
Returns file cache class.
8 9 10 |
# File 'lib/pione/system/file-cache.rb', line 8 def self.cache_method @klass || SimpleCacheMethod end |
.get(uri) ⇒ String
Gets cached data path from the uri resource.
32 33 34 |
# File 'lib/pione/system/file-cache.rb', line 32 def self.get(uri) instance.get(uri) end |
.instance ⇒ CacheMethod
Returns the singleton.
23 24 25 |
# File 'lib/pione/system/file-cache.rb', line 23 def self.instance @instance ||= cache_method.new end |
.put(src, uri) ⇒ Object
Puts the data to uri resource and caches it.
37 38 39 |
# File 'lib/pione/system/file-cache.rb', line 37 def self.put(src, uri) instance.put(src, uri) end |
.set_cache_method(klass) ⇒ void
This method returns an undefined value.
Sets a file cache class.
16 17 18 |
# File 'lib/pione/system/file-cache.rb', line 16 def self.set_cache_method(klass) @klass = klass end |
.shift(old_uri, new_uri) ⇒ void
This method returns an undefined value.
Shifts the resource from old uri to new uri.
47 48 49 |
# File 'lib/pione/system/file-cache.rb', line 47 def self.shift(old_uri, new_uri) instance.shift(old_uri, new_uri) end |