Sha256: aadd1483b6bb69f5fcbba72eedfe1ffa8fd2918eb673bb30e103cf61510e7ccf

Contents?: true

Size: 732 Bytes

Versions: 12

Compression:

Stored size: 732 Bytes

Contents

# frozen_string_literal: true

module Split
  module Persistence
    require 'split/persistence/cookie_adapter'
    require 'split/persistence/dual_adapter'
    require 'split/persistence/redis_adapter'
    require 'split/persistence/session_adapter'

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

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

    def self.persistence_config
      Split.configuration.persistence
    end
    private_class_method :persistence_config
  end
end

Version data entries

12 entries across 12 versions & 2 rubygems

Version Path
ab-split-1.0.2 lib/split/persistence.rb
ab-split-1.0.1 lib/split/persistence.rb
ab-split-1.0.0 lib/split/persistence.rb
split-3.4.1 lib/split/persistence.rb
split-3.4.0 lib/split/persistence.rb
split-3.3.2 lib/split/persistence.rb
split-3.3.1 lib/split/persistence.rb
split-3.3.0 lib/split/persistence.rb
split-3.2.0 lib/split/persistence.rb
split-3.1.1 lib/split/persistence.rb
split-3.1.0 lib/split/persistence.rb
split-3.0.0 lib/split/persistence.rb