Sha256: 2d4ba98be837adfdb352c72810b96f104773d46dde23cf09230bdca132b4a2b8

Contents?: true

Size: 405 Bytes

Versions: 2

Compression:

Stored size: 405 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 nil, 'jsonb'
          Superstore::Adapters::JsonbAdapter
        else
          raise "Unknown adapter #{config[:adapter]}"
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
superstore-2.0.1 lib/superstore/connection.rb
superstore-2.0.0 lib/superstore/connection.rb