Class: Cliqr::Config::Validation::ValidatorFactory::OneOfValidator Private

Inherits:
Validator
  • Object
show all
Defined in:
lib/cliqr/config/validation/validator_factory.rb

Overview

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.

Run multiple validators on a value to assert at-least one of them passes

Instance Method Summary collapse

Methods inherited from Validator

#validate

Constructor Details

#initialize(validator_configs) ⇒ OneOfValidator

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.

Create a new :one_of validator



328
329
330
331
332
333
# File 'lib/cliqr/config/validation/validator_factory.rb', line 328

def initialize(validator_configs)
  @validators = []
  validator_configs.each do |config|
    @validators.push(ValidatorFactory.get(config.first[0], config.first[1]))
  end
end