Method: Argem::DbHelper#initialize

Defined in:
lib/argem/db_helper.rb

#initialize(config) ⇒ DbHelper

Returns a new instance of DbHelper.

Raises:



24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/argem/db_helper.rb', line 24

def initialize(config)
  @_config = config
  # which environment to use?
  raise Error, "Given config object must repond to method :env" if not @_config.respond_to?(:env)
  # where to write the migration file to?
  raise Error, "Given config object must repond to method :migration_root" if not @_config.respond_to?(:migration_root)
  # where to read/write the database.yml to?
  raise Error, "Given config object must repond to method :config_root" if not @_config.respond_to?(:config_root)
  # where to store the database file to ? (sqlite or similar only)
  raise Error, "Given config object must repond to method :db_root" if not @_config.respond_to?(:db_root)
  # where to store the generated model class to?
  raise Error, "Given config object must repond to method :model_root" if not @_config.respond_to?(:model_root)
end