Class: Qonfig::Validation::Validators::Composite Private

Inherits:
Object
  • Object
show all
Defined in:
lib/qonfig/validation/validators/composite.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.

Since:

  • 0.20.0

Instance Method Summary collapse

Constructor Details

#initialize(data_set) ⇒ void

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.

Parameters:

Since:

  • 0.20.0



11
12
13
14
# File 'lib/qonfig/validation/validators/composite.rb', line 11

def initialize(data_set)
  @data_set = data_set
  @validators = data_set.class.validators.dup
end

Instance Method Details

#valid?Boolean

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.

Returns:

  • (Boolean)

Since:

  • 0.20.0



30
31
32
33
34
35
# File 'lib/qonfig/validation/validators/composite.rb', line 30

def valid?
  validate!
  true
rescue Qonfig::ValidationError
  false
end

#validate!void

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.

This method returns an undefined value.

Since:

  • 0.20.0



20
21
22
23
24
# File 'lib/qonfig/validation/validators/composite.rb', line 20

def validate!
  validators.each do |validator|
    validator.validate(data_set)
  end
end