Sha256: 6c92f3254770efea779681a65f9cc7b630f59f5161cf0fe33776cb375340f9d0

Contents?: true

Size: 642 Bytes

Versions: 3

Compression:

Stored size: 642 Bytes

Contents

module Troo
  class Database
    class << self
      # @param  []
      # @param  [Hash]
      # @return []
      def connect(configuration, options = {})
        new(configuration, options).connect
      end
    end

    # @param  []
    # @param  [Hash]
    # @return [Troo::Database]
    def initialize(configuration, options = {})
      @configuration, @options = configuration, options
    end

    # @return [NilClass]
    def connect
      Ohm.connect(db: configuration.database)
    end

    private

    attr_reader :configuration

    def options
      defaults.merge!(@options)
    end

    def defaults
      {}
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
troo-0.0.15 lib/troo/database.rb
troo-0.0.14 lib/troo/database.rb
troo-0.0.13 lib/troo/database.rb