Class: CacheJSON::Base::Cache
- Inherits:
-
Object
- Object
- CacheJSON::Base::Cache
- Defined in:
- lib/cache_json/base.rb
Instance Attribute Summary collapse
-
#args ⇒ Object
Returns the value of attribute args.
-
#options ⇒ Object
Returns the value of attribute options.
Instance Method Summary collapse
- #adapter ⇒ Object
- #cached_results ⇒ Object
- #cached_results=(results) ⇒ Object
- #clear_cache! ⇒ Object
-
#initialize(args: {}, options:) ⇒ Cache
constructor
A new instance of Cache.
Constructor Details
#initialize(args: {}, options:) ⇒ Cache
Returns a new instance of Cache.
40 41 42 43 |
# File 'lib/cache_json/base.rb', line 40 def initialize(args: {}, options:) @args = args @options = end |
Instance Attribute Details
#args ⇒ Object
Returns the value of attribute args.
37 38 39 |
# File 'lib/cache_json/base.rb', line 37 def args @args end |
#options ⇒ Object
Returns the value of attribute options.
38 39 40 |
# File 'lib/cache_json/base.rb', line 38 def @options end |
Instance Method Details
#adapter ⇒ Object
57 58 59 |
# File 'lib/cache_json/base.rb', line 57 def adapter @adapter ||= CacheJSON::Adapters::Redis.new(args: args, options: ) end |
#cached_results ⇒ Object
45 46 47 |
# File 'lib/cache_json/base.rb', line 45 def cached_results adapter.cached_results end |
#cached_results=(results) ⇒ Object
49 50 51 |
# File 'lib/cache_json/base.rb', line 49 def cached_results=(results) adapter.cached_results = results end |
#clear_cache! ⇒ Object
53 54 55 |
# File 'lib/cache_json/base.rb', line 53 def clear_cache! adapter.clear_cache! end |