Class: Sprockets::Sass::CacheStore
- Inherits:
-
Sass::CacheStores::Base
- Object
- Sass::CacheStores::Base
- Sprockets::Sass::CacheStore
- Defined in:
- lib/sprockets/sass/cache_store.rb
Instance Attribute Summary collapse
-
#environment ⇒ Object
readonly
Returns the value of attribute environment.
Instance Method Summary collapse
- #_retrieve(key, version, sha) ⇒ Object
- #_store(key, version, sha, contents) ⇒ Object
-
#initialize(environment) ⇒ CacheStore
constructor
A new instance of CacheStore.
Constructor Details
#initialize(environment) ⇒ CacheStore
Returns a new instance of CacheStore.
8 9 10 |
# File 'lib/sprockets/sass/cache_store.rb', line 8 def initialize(environment) @environment = environment end |
Instance Attribute Details
#environment ⇒ Object (readonly)
Returns the value of attribute environment.
6 7 8 |
# File 'lib/sprockets/sass/cache_store.rb', line 6 def environment @environment end |
Instance Method Details
#_retrieve(key, version, sha) ⇒ Object
16 17 18 19 20 21 22 23 24 |
# File 'lib/sprockets/sass/cache_store.rb', line 16 def _retrieve(key, version, sha) if obj = environment.send(:cache_get, "sass/#{key}") return unless obj[:version] == version return unless obj[:sha] == sha obj[:obj] else nil end end |
#_store(key, version, sha, contents) ⇒ Object
12 13 14 |
# File 'lib/sprockets/sass/cache_store.rb', line 12 def _store(key, version, sha, contents) environment.send :cache_set, "sass/#{key}", { :version => version, :sha => sha, :contents => contents } end |