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
- #cache_expiring_soon? ⇒ Boolean
- #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
45 46 47 48 |
# File 'lib/cache_json/base.rb', line 45 def initialize(args: {}, options:) @args = args @options = end |
Instance Attribute Details
#args ⇒ Object
Returns the value of attribute args.
42 43 44 |
# File 'lib/cache_json/base.rb', line 42 def args @args end |
#options ⇒ Object
Returns the value of attribute options.
43 44 45 |
# File 'lib/cache_json/base.rb', line 43 def @options end |
Instance Method Details
#adapter ⇒ Object
66 67 68 |
# File 'lib/cache_json/base.rb', line 66 def adapter @adapter ||= CacheJSON::Adapters::Redis.new(args: args, options: ) end |
#cache_expiring_soon? ⇒ Boolean
62 63 64 |
# File 'lib/cache_json/base.rb', line 62 def cache_expiring_soon? adapter.cache_expiring_soon? end |
#cached_results ⇒ Object
50 51 52 |
# File 'lib/cache_json/base.rb', line 50 def cached_results adapter.cached_results end |
#cached_results=(results) ⇒ Object
54 55 56 |
# File 'lib/cache_json/base.rb', line 54 def cached_results=(results) adapter.cached_results = results end |
#clear_cache! ⇒ Object
58 59 60 |
# File 'lib/cache_json/base.rb', line 58 def clear_cache! adapter.clear_cache! end |