Module: Split::Persistence

Defined in:
lib/split/persistence.rb,
lib/split/persistence/redis_adapter.rb,
lib/split/persistence/cookie_adapter.rb,
lib/split/persistence/session_adapter.rb

Defined Under Namespace

Classes: CookieAdapter, RedisAdapter, SessionAdapter

Constant Summary collapse

ADAPTERS =
{
  :cookie => Split::Persistence::CookieAdapter,
  :session => Split::Persistence::SessionAdapter
}

Class Method Summary collapse

Class Method Details

.adapterObject



12
13
14
15
16
17
18
19
20
# File 'lib/split/persistence.rb', line 12

def self.adapter
  if persistence_config.is_a?(Symbol)
    adapter_class = ADAPTERS[persistence_config]
    raise Split::InvalidPersistenceAdapterError unless adapter_class
  else
    adapter_class = persistence_config
  end
  adapter_class
end