Class: Sprockets::SassProcessor::CacheStore

Inherits:
Sass::CacheStores::Base
  • Object
show all
Defined in:
lib/sprockets/sass_cache_store.rb

Overview

Internal: Cache wrapper for Sprockets cache adapter.

Constant Summary collapse

VERSION =
'1'

Instance Method Summary collapse

Constructor Details

#initialize(cache, version) ⇒ CacheStore

Returns a new instance of CacheStore.


10
11
12
# File 'lib/sprockets/sass_cache_store.rb', line 10

def initialize(cache, version)
  @cache, @version = cache, "#{VERSION}/#{version}"
end

Instance Method Details

#_retrieve(key, version, sha) ⇒ Object


18
19
20
# File 'lib/sprockets/sass_cache_store.rb', line 18

def _retrieve(key, version, sha)
  @cache.get("#{@version}/#{version}/#{key}/#{sha}", true)
end

#_store(key, version, sha, contents) ⇒ Object


14
15
16
# File 'lib/sprockets/sass_cache_store.rb', line 14

def _store(key, version, sha, contents)
  @cache.set("#{@version}/#{version}/#{key}/#{sha}", contents, true)
end

#path_to(key) ⇒ Object


22
23
24
# File 'lib/sprockets/sass_cache_store.rb', line 22

def path_to(key)
  key
end