Method: Persistent::Cache#initialize
- Defined in:
- lib/persistent-cache.rb
#initialize(storage_details, fresh = FRESH, storage = STORAGE_SQLITE) ⇒ Cache
Returns a new instance of Cache.
21 22 23 24 25 26 27 28 29 |
# File 'lib/persistent-cache.rb', line 21 def initialize(storage_details, fresh = FRESH, storage = STORAGE_SQLITE) raise ArgumentError.new("No storage details provided") if storage_details.nil? or storage_details == "" @storage = create_storage(storage, storage_details) @fresh = fresh @storage_details = storage_details raise ArgumentError.new("Unsupported storage type #{storage}}") if @storage.nil? end |