Sha256: 41fe140e15723f86c0f8525c7b2547f3300cdd158228a786f1c91e1700a356e5

Contents?: true

Size: 480 Bytes

Versions: 3

Compression:

Stored size: 480 Bytes

Contents

require_relative "database_configuration"

module Snowglobe
  class Database
    ADAPTER_NAME = ENV.fetch("DATABASE_ADAPTER", "sqlite3").to_sym

    attr_reader :config

    def initialize
      @config = DatabaseConfiguration.for(
        Snowglobe.configuration.database_name,
        ADAPTER_NAME,
      )
    end

    def name
      config.database
    end

    def adapter_name
      config.adapter
    end

    def adapter_class
      config.adapter_class
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
snowglobe-0.3.0 lib/snowglobe/database.rb
snowglobe-0.2.0 lib/snowglobe/database.rb
snowglobe-0.1.0 lib/snowglobe/database.rb