Method: Ardb::Config#validate!

Defined in:
lib/ardb.rb

#validate!Object



121
122
123
124
125
126
127
128
129
130
131
132
# File 'lib/ardb.rb', line 121

def validate!
  if self.adapter.to_s.empty? || self.database.to_s.empty?
    raise ConfigurationError, "an adapter and database must be provided"
  end

  if !VALID_SCHEMA_FORMATS.include?(self.schema_format)
    raise ConfigurationError, "schema format must be one of: " \
                              "#{VALID_SCHEMA_FORMATS.join(", ")}"
  end

  true
end