Sha256: 8707a8abb6709e2cd25e18ba4ae5b5578dd6119c02713277f94cc7264e47fd2e

Contents?: true

Size: 480 Bytes

Versions: 1

Compression:

Stored size: 480 Bytes

Contents

module PgHero
  class Database
    attr_reader :id, :config, :connection_model

    def initialize(id, config)
      @id = id
      @config = config
      @connection_model =
        Class.new(PgHero::Connection) do
          def self.name
            "PgHero::Connection::#{object_id}"
          end
          establish_connection(config["url"]) if config["url"]
        end
    end

    def db_instance_identifier
      @config["database_instance_identifier"]
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
pghero-1.1.2 lib/pghero/database.rb