Class: ActiveMatrix::Util::RailsCacheAdapter
- Defined in:
- lib/active_matrix/util/rails_cache_adapter.rb
Instance Attribute Summary collapse
-
#client ⇒ Object
Returns the value of attribute client.
Instance Method Summary collapse
- #cleanup ⇒ Object
- #clear ⇒ Object
- #delete(key) ⇒ Object
- #exist?(key) ⇒ Boolean
-
#initialize ⇒ RailsCacheAdapter
constructor
A new instance of RailsCacheAdapter.
- #read(key, _options = {}) ⇒ Object
- #write(key, value, expires_in: nil) ⇒ Object
Constructor Details
#initialize ⇒ RailsCacheAdapter
Returns a new instance of RailsCacheAdapter.
8 9 10 |
# File 'lib/active_matrix/util/rails_cache_adapter.rb', line 8 def initialize @cache = ::Rails.cache end |
Instance Attribute Details
#client ⇒ Object
Returns the value of attribute client.
6 7 8 |
# File 'lib/active_matrix/util/rails_cache_adapter.rb', line 6 def client @client end |
Instance Method Details
#cleanup ⇒ Object
32 33 34 |
# File 'lib/active_matrix/util/rails_cache_adapter.rb', line 32 def cleanup # Rails.cache handles its own cleanup end |
#clear ⇒ Object
28 29 30 |
# File 'lib/active_matrix/util/rails_cache_adapter.rb', line 28 def clear @cache.clear end |
#delete(key) ⇒ Object
24 25 26 |
# File 'lib/active_matrix/util/rails_cache_adapter.rb', line 24 def delete(key) @cache.delete(key) end |
#exist?(key) ⇒ Boolean
20 21 22 |
# File 'lib/active_matrix/util/rails_cache_adapter.rb', line 20 def exist?(key) @cache.exist?(key) end |
#read(key, _options = {}) ⇒ Object
12 13 14 |
# File 'lib/active_matrix/util/rails_cache_adapter.rb', line 12 def read(key, = {}) @cache.read(key) end |
#write(key, value, expires_in: nil) ⇒ Object
16 17 18 |
# File 'lib/active_matrix/util/rails_cache_adapter.rb', line 16 def write(key, value, expires_in: nil) @cache.write(key, value, expires_in: expires_in) end |