Class: AmazonAssociate::CacheFactory
- Inherits:
-
Object
- Object
- AmazonAssociate::CacheFactory
- Defined in:
- lib/amazon_associate/cache_factory.rb
Class Method Summary collapse
- .cache(request, response, strategy) ⇒ Object
- .get(request, strategy) ⇒ Object
- .initialize_options(options) ⇒ Object
- .sweep(strategy) ⇒ Object
Class Method Details
.cache(request, response, strategy) ⇒ Object
3 4 5 |
# File 'lib/amazon_associate/cache_factory.rb', line 3 def self.cache(request, response, strategy) strategy_class_hash[strategy].cache(request, response) end |
.get(request, strategy) ⇒ Object
15 16 17 |
# File 'lib/amazon_associate/cache_factory.rb', line 15 def self.get(request, strategy) strategy_class_hash[strategy].get(request) end |
.initialize_options(options) ⇒ Object
7 8 9 10 11 12 13 |
# File 'lib/amazon_associate/cache_factory.rb', line 7 def self.() #check for a valid caching strategy unless self.strategy_class_hash.keys.include?([:caching_strategy]) raise AmazonAssociate::ConfigurationError, "Invalid caching strategy" end strategy_class_hash[[:caching_strategy]].() end |
.sweep(strategy) ⇒ Object
19 20 21 |
# File 'lib/amazon_associate/cache_factory.rb', line 19 def self.sweep(strategy) strategy_class_hash[strategy].sweep end |