Class: Evilution::Config::Validators::ExampleTargetingCache

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

Class Method Summary collapse

Class Method Details

.call(value) ⇒ Object



6
7
8
9
10
11
12
13
14
# File 'lib/evilution/config/validators/example_targeting_cache.rb', line 6

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

  normalized = normalize_keys(value)
  merged = Evilution::Config::DEFAULTS[:example_targeting_cache].merge(normalized)
  require_positive_int!(merged, :max_files)
  require_positive_int!(merged, :max_blocks)
  merged
end