Module: Card::Cache::All
- Included in:
- Card
- Defined in:
- lib/card/cache/all.rb
Overview
cache-related instance methods available to all Cards
Instance Method Summary collapse
- #ensure_view_cache_key(cache_key) ⇒ Object
- #expire(cache_type = nil) ⇒ Object
- #view_cache_clean? ⇒ Boolean
Instance Method Details
#ensure_view_cache_key(cache_key) ⇒ Object
17 18 19 20 21 22 |
# File 'lib/card/cache/all.rb', line 17 def ensure_view_cache_key cache_key return if view_cache_keys.include? cache_key view_cache_keys << cache_key hard_write_view_cache_keys end |
#expire(cache_type = nil) ⇒ Object
5 6 7 8 9 10 11 |
# File 'lib/card/cache/all.rb', line 5 def expire cache_type=nil return unless (cache_class = cache_class_from_type cache_type) expire_views expire_names cache_class expire_id cache_class end |
#view_cache_clean? ⇒ Boolean
13 14 15 |
# File 'lib/card/cache/all.rb', line 13 def view_cache_clean? !db_content_changed? end |