Sha256: dbe3af461e71cab45ef1a8ff76db13217b0f10d65813713c490adf98e8ca3ef8

Contents?: true

Size: 528 Bytes

Versions: 1

Compression:

Stored size: 528 Bytes

Contents

require "singleton"
require "yaml"

module ActiveGeoDb
  class ConnectionConfiguration
    include Singleton

    # Key in Rails database configuration under which the configuration for OpenGeoDb database
    # can be found
    CONFIGURATION_KEY = "open_geo_db"

    # Read configuration file and load appropriate section
    def load_file(path)
      @configuration_data = YAML.load_file(path)[CONFIGURATION_KEY]
    end

    # Return previously loaded configuration
    def to_hash
      @configuration_data
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
active_geo_db-0.0.2 lib/active_geo_db/connection_configuration.rb