Class: SplitIoClient::Cache::Repositories::MetricsRepository

Inherits:
SplitIoClient::Cache::Repository show all
Extended by:
Forwardable
Defined in:
lib/splitclient-rb/cache/repositories/metrics_repository.rb

Overview

Repository which forwards impressions interface to the selected adapter

Instance Method Summary collapse

Methods inherited from SplitIoClient::Cache::Repository

#set_string, #string

Constructor Details

#initialize(config) ⇒ MetricsRepository

Returns a new instance of MetricsRepository.



10
11
12
13
14
15
16
17
18
# File 'lib/splitclient-rb/cache/repositories/metrics_repository.rb', line 10

def initialize(config)
  super(config)
  @repository = case @config.metrics_adapter.class.to_s
  when 'SplitIoClient::Cache::Adapters::MemoryAdapter'
    Repositories::Metrics::MemoryRepository.new(@config)
  when 'SplitIoClient::Cache::Adapters::RedisAdapter'
    Repositories::Metrics::RedisRepository.new(@config)
  end
end