class SwitchDb::Command::Config

Public Instance Methods

run(arguments = {}) click to toggle source
# File lib/switch_db/command/config.rb, line 6
def run(arguments = {})
  arguments.each do |key, value|
    if SwitchDb.configuration.configuration_keys.include?(key.to_sym)
      SwitchDb.configuration.public_send("#{key}=", value)
    else
      raise SwitchDb::UnknownConfigurationKey, "Unknown configuration given (#{key})"
    end
  end

  SwitchDb.configuration.write_configuration_file
end