class Bookwatch::Config::Checkers::RequiredKeysChecker

Constants

MissingRequiredKeyError

Public Instance Methods

check(config) click to toggle source
# File lib/bookwatch/config/checkers/required_keys_checker.rb, line 9
def check(config)
  missing_keys = Config::Configuration::CONFIG_REQUIRED_KEYS.reject { |key| config.has_option?(key) }
  if missing_keys.any?
    MissingRequiredKeyError.new("Your config.yml is missing required key(s). Required keys are #{missing_keys.join(", ")}.")
  end
end