Sha256: 08acf299fe0772f370010d0ae08f2db2d027c741327b6bf50df98a5e992de002

Contents?: true

Size: 1012 Bytes

Versions: 1

Compression:

Stored size: 1012 Bytes

Contents

require 'fulmar/infrastructure/cache/dummy_cache_service'
require 'fulmar/infrastructure/cache/neos_cache_service'
require 'fulmar/infrastructure/cache/symfony_cache_service'

module Fulmar
  module Domain
    module Service
      # Provides a common interface for all environment specific cache services
      class CacheService
        attr_reader :type, :cache

        def initialize(shell, config, type = :none)
          @type = type
          @cache = case type
                   when :neos
                     Fulmar::Infrastructure::Service::Cache::NeosCacheService.new(shell, config)
                   when :symfony
                     Fulmar::Infrastructure::Service::Cache::SymfonyCacheService.new(shell, config)
                   else
                     Fulmar::Infrastructure::Service::Cache::DummyCacheService.new(shell, config)
                   end
        end

        def method_missing(name, parameters)
          @cache.call(name, parameters)
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
fulmar-0.6.3 lib/fulmar/domain/service/cache_service.rb