Class: Qonfig::Validator::Builder Private

Inherits:
Object
  • Object
show all
Defined in:
lib/qonfig/validator/builder.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.13.0

Defined Under Namespace

Classes: AttributeConsistency

Constant Summary collapse

EMPTY_SETTING_KEY_PATTERN =

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.

Since:

  • 0.13.0

nil
NO_RUNTIME_VALIDATION_METHOD =

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.

Since:

  • 0.13.0

nil
NO_VALIDATION_LOGIC =

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.

Since:

  • 0.13.0

nil
NO_PREDEFINED_VALIDATOR =

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.

Since:

  • 0.13.0

nil
DEFAULT_STRICT_BEHAVIOUR =

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.

Since:

  • 0.17.0

false

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(setting_key_pattern, predefined_validator_name, runtime_validation_method, strict, validation_logic) ⇒ 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.

Since:

  • 0.13.0



74
75
76
77
78
79
80
81
82
83
84
85
86
# File 'lib/qonfig/validator/builder.rb', line 74

def initialize(
  setting_key_pattern,
  predefined_validator_name,
  runtime_validation_method,
  strict,
  validation_logic
)
  @setting_key_pattern = setting_key_pattern
  @predefined_validator_name = predefined_validator_name
  @runtime_validation_method = runtime_validation_method
  @strict = strict
  @validation_logic = validation_logic
end

Class Method Details

.build(setting_key_pattern: EMPTY_SETTING_KEY_PATTERN, runtime_validation_method: NO_RUNTIME_VALIDATION_METHOD, validation_logic: NO_VALIDATION_LOGIC, strict: DEFAULT_STRICT_BEHAVIOUR, predefined_validator: NO_PREDEFINED_VALIDATOR) ⇒ Qonfig::Validator::MethodBased, Qonfig::Validator::ProcBased

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.

Options Hash (setting_key_pattern:):

  • (String, Symbol, NilClass)

Options Hash (runtime_validation_method:):

  • (String, Symbol, NilClass)

Options Hash (validation_logic:):

  • (Proc, NilClass)

Options Hash (strict:):

  • (Boolean)

Options Hash (predefined_validator:):

  • (String, Symbol, NilClass)

Since:

  • 0.13.0



48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# File 'lib/qonfig/validator/builder.rb', line 48

def build(
  setting_key_pattern: EMPTY_SETTING_KEY_PATTERN,
  runtime_validation_method: NO_RUNTIME_VALIDATION_METHOD,
  validation_logic: NO_VALIDATION_LOGIC,
  strict: DEFAULT_STRICT_BEHAVIOUR,
  predefined_validator: NO_PREDEFINED_VALIDATOR
)
  new(
    setting_key_pattern,
    predefined_validator,
    runtime_validation_method,
    strict,
    validation_logic
  ).build
end

Instance Method Details

#buildQonfig::Validator::MethodBased, Qonfig::Validator::ProcBased

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.

Since:

  • 0.13.0



92
93
94
95
# File 'lib/qonfig/validator/builder.rb', line 92

def build
  validate_attributes!
  build_validator
end