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.



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

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

Instance Method Details

#_retrieve(key, version, sha) ⇒ Object



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

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

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



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

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

#path_to(key) ⇒ Object



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

def path_to(key)
  key
end