Class: ConvenientService::Support::Cache
- Inherits:
-
Object
- Object
- ConvenientService::Support::Cache
- Defined in:
- lib/convenient_service/support/cache.rb,
lib/convenient_service/support/cache/constants.rb,
lib/convenient_service/support/cache/exceptions.rb,
lib/convenient_service/support/cache/entities/key.rb,
lib/convenient_service/support/cache/entities/caches/base.rb,
lib/convenient_service/support/cache/entities/caches/hash.rb,
lib/convenient_service/support/cache/entities/caches/array.rb,
lib/convenient_service/support/cache/entities/caches/thread_safe_hash.rb,
lib/convenient_service/support/cache/entities/caches/thread_safe_array.rb,
lib/convenient_service/support/cache/entities/caches/array/entities/pair.rb more...
Defined Under Namespace
Modules: Constants, Entities, Exceptions
Class Method Summary collapse
- .backed_by(backend) ⇒ Class<ConvenientService::Support::Cache::Entities::Caches::Base>
- .new ⇒ ConvenientService::Support::Cache::Entities::Caches::Base
Class Method Details
.backed_by(backend) ⇒ Class<ConvenientService::Support::Cache::Entities::Caches::Base>
27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/convenient_service/support/cache.rb', line 27 def backed_by(backend) case backend when Constants::Backends::ARRAY Entities::Caches::Array when Constants::Backends::HASH Entities::Caches::Hash when Constants::Backends::THREAD_SAFE_ARRAY Entities::Caches::ThreadSafeArray when Constants::Backends::THREAD_SAFE_HASH Entities::Caches::ThreadSafeHash else ::ConvenientService.raise Exceptions::NotSupportedBackend.new(backend: backend) end end |
.new ⇒ ConvenientService::Support::Cache::Entities::Caches::Base
19 20 21 |
# File 'lib/convenient_service/support/cache.rb', line 19 def new(...) backed_by(Constants::Backends::DEFAULT).new(...) end |