Module: Split::Persistence

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

Defined Under Namespace

Classes: CookieAdapter, DualAdapter, RedisAdapter, SessionAdapter

Constant Summary collapse

ADAPTERS =
{
  cookie: Split::Persistence::CookieAdapter,
  session: Split::Persistence::SessionAdapter,
  redis: Split::Persistence::RedisAdapter,
  dual_adapter: Split::Persistence::DualAdapter
}.freeze

Class Method Summary collapse

Class Method Details

.adapterObject



17
18
19
20
21
22
23
# File 'lib/split/persistence.rb', line 17

def self.adapter
  if persistence_config.is_a?(Symbol)
    ADAPTERS.fetch(persistence_config) { raise Split::InvalidPersistenceAdapterError }
  else
    persistence_config
  end
end