Class: Evilution::Config::Validators::ExampleTargetingStrategy Private

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

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Constant Summary collapse

STRATEGIES =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

%i[lexical coverage].freeze

Class Method Summary collapse

Class Method Details

.call(value) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/evilution/config/validators/example_targeting_strategy.rb', line 8

def self.call(value)
  unless value.is_a?(String) || value.is_a?(Symbol)
    raise Evilution::ConfigError,
          "example_targeting_strategy must be lexical or coverage, got #{value.inspect}"
  end

  sym = value.to_sym
  unless STRATEGIES.include?(sym)
    raise Evilution::ConfigError,
          "example_targeting_strategy must be lexical or coverage, got #{sym.inspect}"
  end

  sym
end