Class: Card::Rule::Cache
- Inherits:
-
Object
show all
- Defined in:
- lib/card/rule/cache.rb
Overview
a cache of all card rules in the deck
Class Method Summary
collapse
Class Method Details
.clear ⇒ Object
36
37
38
|
# File 'lib/card/rule/cache.rb', line 36
def clear
Card.cache.write cache_key, nil
end
|
.populate ⇒ Object
32
33
34
|
# File 'lib/card/rule/cache.rb', line 32
def populate
Card.cache.write cache_key, lookup_hash
end
|
.read ⇒ Object
28
29
30
|
# File 'lib/card/rule/cache.rb', line 28
def read
Card.cache.read(cache_key) || populate
end
|