Sha256: dbd0effdb42e924dbbddcd6f7a0de4fccc4120fadb5f691269536c290222f871

Contents?: true

Size: 740 Bytes

Versions: 1

Compression:

Stored size: 740 Bytes

Contents

module Legion
  module Cache
    module Settings
      def self.default
        {
          driver:     'dalli',
          servers:    ['127.0.0.1:11211'],
          connected:  false,
          enabled:    true,
          namespace:  'legion',
          compress:   false,
          failover:   true,
          threadsafe: true,
          expires_in: 0,
          cache_nils: false,
          pool_size:  1,
          serializer: Legion::JSON
        }
      end

      def self.driver
        if Gem::Specification.find_by_name('dalli')
          'dalli'
        elsif Gem::Specification.find_by_name('redis')
          'redis'
        else
          raise NameError('Legion::Cache.driver is nil')
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
legion-cache-0.2.0 lib/legion/cache/settings.rb