Class: Pagelime::StorageEngine

Inherits:
Object
  • Object
show all
Defined in:
lib/pagelime/storage_engine.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#cacheObject (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_sharedObject



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