Class: Evilution::Config::Validators::SpecMappings

Inherits:
Base
  • Object
show all
Defined in:
lib/evilution/config/validators/spec_mappings.rb

Class Method Summary collapse

Class Method Details

.call(value) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/evilution/config/validators/spec_mappings.rb', line 6

def self.call(value)
  return {} if value.nil?

  raise Evilution::ConfigError, "spec_mappings must be a Hash, got #{value.class}" unless value.is_a?(Hash)

  normalized = value.each_with_object({}) do |(source, specs), acc|
    key = normalize_key(source)
    acc[key] = normalize_value(key, specs)
  end

  warn_missing(normalized)
  normalized
end