Class: Pagelime::StorageEngine
- Inherits:
-
Object
- Object
- Pagelime::StorageEngine
- Defined in:
- lib/pagelime/storage_engine.rb
Instance Attribute Summary collapse
-
#cache ⇒ Object
readonly
Returns the value of attribute cache.
Instance Method Summary collapse
- #fetch_path(page_path) ⇒ Object
- #fetch_shared ⇒ Object
-
#initialize(config, cache_engine) ⇒ StorageEngine
constructor
A new instance of StorageEngine.
Constructor Details
#initialize(config, cache_engine) ⇒ StorageEngine
Returns a new instance of StorageEngine.
6 7 8 9 |
# File 'lib/pagelime/storage_engine.rb', line 6 def initialize(config, cache_engine) @config = config @cache = cache_engine# || CacheEngine.new(config) end |
Instance Attribute Details
#cache ⇒ Object (readonly)
Returns the value of attribute cache.
4 5 6 |
# File 'lib/pagelime/storage_engine.rb', line 4 def cache @cache end |
Instance Method Details
#fetch_path(page_path) ⇒ Object
11 12 13 14 15 |
# File 'lib/pagelime/storage_engine.rb', line 11 def fetch_path(page_path) @cache.fetch_path page_path do @config.storage.fetch_path(page_path) end end |
#fetch_shared ⇒ Object
17 18 19 20 21 |
# File 'lib/pagelime/storage_engine.rb', line 17 def fetch_shared @cache.fetch_shared do @config.storage.fetch_shared end end |