Class: ActiveGeoDb::ConnectionConfiguration

Inherits:
Object
  • Object
show all
Includes:
Singleton
Defined in:
lib/active_geo_db/connection_configuration.rb

Constant Summary collapse

CONFIGURATION_KEY =

Key in Rails database configuration under which the configuration for OpenGeoDb database can be found

"open_geo_db"

Instance Method Summary collapse

Instance Method Details

#load_file(path) ⇒ Object

Read configuration file and load appropriate section



13
14
15
# File 'lib/active_geo_db/connection_configuration.rb', line 13

def load_file(path)
  @configuration_data = YAML.load_file(path)[CONFIGURATION_KEY]
end

#to_hashObject

Return previously loaded configuration



18
19
20
# File 'lib/active_geo_db/connection_configuration.rb', line 18

def to_hash
  @configuration_data
end