Sha256: 0edfd23b7841a32071e7293a785bf624a1c6e27e1698cbeb0c36ef21fac48fc5

Contents?: true

Size: 482 Bytes

Versions: 13

Compression:

Stored size: 482 Bytes

Contents

module Superstore
  module Connection
    extend ActiveSupport::Concern

    module ClassMethods
      def adapter
        @@adapter ||= adapter_class.new(config)
      end

      def adapter_class
        case config[:adapter]
        when 'hstore'
          Superstore::Adapters::HstoreAdapter
        when nil, 'cassandra'
          Superstore::Adapters::CassandraAdapter
        else
          raise "Unknown adapter #{config[:adapter]}"
        end
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
superstore-1.2.0 lib/superstore/connection.rb
superstore-1.1.4 lib/superstore/connection.rb
superstore-1.1.3 lib/superstore/connection.rb
superstore-1.1.2 lib/superstore/connection.rb
superstore-1.1.1 lib/superstore/connection.rb
superstore-1.1.0 lib/superstore/connection.rb
superstore-1.0.12 lib/superstore/connection.rb
superstore-1.0.11 lib/superstore/connection.rb
superstore-1.0.10 lib/superstore/connection.rb
superstore-1.0.9 lib/superstore/connection.rb
superstore-1.0.8 lib/superstore/connection.rb
superstore-1.0.7 lib/superstore/connection.rb
superstore-1.0.6 lib/superstore/connection.rb