Class: Evilution::Config::Validators::Isolation Private
- Defined in:
- lib/evilution/config/validators/isolation.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
- ALLOWED =
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[auto fork in_process].freeze
- MESSAGE =
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.
"isolation must be auto, fork, or in_process"
Class Method Summary collapse
- .call(value) ⇒ Object private
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.
9 10 11 12 13 14 15 16 17 18 |
# File 'lib/evilution/config/validators/isolation.rb', line 9 def self.call(value) raise Evilution::ConfigError, "#{MESSAGE}, got nil" if value.nil? raise Evilution::ConfigError, "#{MESSAGE}, got #{value.inspect}" unless value.is_a?(String) || value.is_a?(Symbol) sym = value.to_sym return sym if ALLOWED.include?(sym) raise Evilution::ConfigError, "#{MESSAGE}, got #{sym.inspect}" end |