Class: Munna::Cache
Instance Method Summary collapse
- #clear ⇒ Object
-
#initialize ⇒ Cache
constructor
A new instance of Cache.
- #method_missing(name, *args, &block) ⇒ Object
- #values ⇒ Object
Constructor Details
#initialize ⇒ Cache
Returns a new instance of Cache.
7 8 9 |
# File 'lib/munna/cache.rb', line 7 def initialize values end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(name, *args, &block) ⇒ Object
20 21 22 23 24 25 26 27 28 |
# File 'lib/munna/cache.rb', line 20 def method_missing(name, *args, &block) if /^write$|^delete$/ =~ name.to_s CacheHelper.handle_key(name, args.first) elsif /(?<type>.+)_matched$/ =~ name.to_s CacheHelper.handle_matched(type, args.first) else super(name, *args, &block) end end |