Class: UrlResolver::Cache
- Inherits:
-
Object
- Object
- UrlResolver::Cache
- Defined in:
- lib/url_resolver/cache.rb
Instance Method Summary collapse
-
#initialize(cache = nil) ⇒ Cache
constructor
A new instance of Cache.
Constructor Details
#initialize(cache = nil) ⇒ Cache
Returns a new instance of Cache.
3 4 5 6 7 8 9 10 11 12 13 |
# File 'lib/url_resolver/cache.rb', line 3 def initialize(cache = nil) @cache = cache if cache.class.name == 'Redis' extend CacheImplementations::RedisCache elsif cache.class.name == 'NilClass' extend CacheImplementations::NilClassCache else raise ArgumentError.new("Invalid cache class: #{cache.class}") end end |