Sha256: c3e5e35ce659fe9adc8913255ec0c0be9dba772eaa9ab7ed70497e6f22c73e49

Contents?: true

Size: 749 Bytes

Versions: 31

Compression:

Stored size: 749 Bytes

Contents

require 'forwardable'

module SplitIoClient
  module Cache
    module Repositories
      # Repository which forwards impressions interface to the selected adapter
      class ImpressionsRepository < Repository
        extend Forwardable
        def_delegators :@adapter, :add, :add_bulk, :clear, :empty?

        def initialize(adapter, config)
          @config = config
          @adapter = case adapter.class.to_s
          when 'SplitIoClient::Cache::Adapters::MemoryAdapter'
            Repositories::Impressions::MemoryRepository.new(adapter, config)
          when 'SplitIoClient::Cache::Adapters::RedisAdapter'
            Repositories::Impressions::RedisRepository.new(adapter, config)
          end
        end
      end
    end
  end
end

Version data entries

31 entries across 31 versions & 1 rubygems

Version Path
splitclient-rb-4.4.0 lib/splitclient-rb/cache/repositories/impressions_repository.rb
splitclient-rb-4.3.2 lib/splitclient-rb/cache/repositories/impressions_repository.rb
splitclient-rb-4.3.1 lib/splitclient-rb/cache/repositories/impressions_repository.rb
splitclient-rb-4.3.0 lib/splitclient-rb/cache/repositories/impressions_repository.rb
splitclient-rb-4.3.0.canary.2 lib/splitclient-rb/cache/repositories/impressions_repository.rb
splitclient-rb-4.3.0.canary.1 lib/splitclient-rb/cache/repositories/impressions_repository.rb
splitclient-rb-4.2.2 lib/splitclient-rb/cache/repositories/impressions_repository.rb
splitclient-rb-4.2.1 lib/splitclient-rb/cache/repositories/impressions_repository.rb
splitclient-rb-4.2.0 lib/splitclient-rb/cache/repositories/impressions_repository.rb
splitclient-rb-4.1.0 lib/cache/repositories/impressions_repository.rb
splitclient-rb-4.1.0.pre.rc2 lib/cache/repositories/impressions_repository.rb
splitclient-rb-4.1.0.pre.rc1 lib/cache/repositories/impressions_repository.rb
splitclient-rb-4.0.0 lib/cache/repositories/impressions_repository.rb
splitclient-rb-4.0.0.pre.rc1 lib/cache/repositories/impressions_repository.rb
splitclient-rb-3.3.0 lib/cache/repositories/impressions_repository.rb
splitclient-rb-3.3.0.pre.rc1 lib/cache/repositories/impressions_repository.rb
splitclient-rb-3.2.4 lib/cache/repositories/impressions_repository.rb
splitclient-rb-3.2.4.pre.rc5 lib/cache/repositories/impressions_repository.rb
splitclient-rb-3.2.4.pre.rc4 lib/cache/repositories/impressions_repository.rb
splitclient-rb-3.2.4.pre.rc3 lib/cache/repositories/impressions_repository.rb