Module: MP4::Cache
- Defined in:
- lib/mp4/cache.rb,
lib/mp4/cache/memory.rb,
lib/mp4/cache/sqlite.rb
Defined Under Namespace
Constant Summary collapse
- BACKENDS =
{ sqlite: 'MP4::Cache::SQLite', memory: 'MP4::Cache::Memory', }.freeze
Class Method Summary collapse
Class Method Details
.build(backend, location = nil) ⇒ Object
7 8 9 10 11 12 |
# File 'lib/mp4/cache.rb', line 7 def self.build(backend, location = nil) klass_name = BACKENDS.fetch(backend) do raise ArgumentError, "unknown cache backend: #{backend.inspect} (known: #{BACKENDS.keys.inspect})" end Object.const_get(klass_name).new(location) end |