Module: ActiveEndpoint::Routes::Cache::Proxy

Defined in:
lib/active_endpoint/routes/cache/proxy.rb,
lib/active_endpoint/routes/cache/proxy/redis_store_proxy.rb

Defined Under Namespace

Classes: AdapterError, RedisStoreProxy

Constant Summary collapse

CLIENTS =
{
  redis: 'RedisStoreProxy'
}.freeze

Class Method Summary collapse

Class Method Details

.build(adapter) ⇒ Object



11
12
13
14
15
16
17
18
# File 'lib/active_endpoint/routes/cache/proxy.rb', line 11

def self.build(adapter)
  unless CLIENTS.keys.include?(adapter)
    message "You try to use unsupported cache store adapter! #{adapter}\n"
    raise ActiveEndpoint::Routes::Cache::Proxy::AdapterError.new(message)
  end

  "ActiveEndpoint::Routes::Cache::Proxy::#{CLIENTS[adapter]}".constantize.new
end