Class: Sass::Rails::CacheStore
- Inherits:
-
CacheStores::Base
- Object
- CacheStores::Base
- Sass::Rails::CacheStore
- Defined in:
- lib/sass/rails/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.
- #path_to(key) ⇒ Object
Constructor Details
#initialize(environment) ⇒ CacheStore
Returns a new instance of CacheStore.
8 9 10 |
# File 'lib/sass/rails/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/sass/rails/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/sass/rails/cache_store.rb', line 16 def _retrieve(key, version, sha) if obj = environment.cache_get("sass/#{key}") return unless obj[:version] == version return unless obj[:sha] == sha obj[:contents] else nil end end |
#_store(key, version, sha, contents) ⇒ Object
12 13 14 |
# File 'lib/sass/rails/cache_store.rb', line 12 def _store(key, version, sha, contents) environment.cache_set("sass/#{key}", {:version => version, :sha => sha, :contents => contents}) end |
#path_to(key) ⇒ Object
26 27 28 |
# File 'lib/sass/rails/cache_store.rb', line 26 def path_to(key) key end |