Module: Qonfig::Validator::Predefined::RegistryControlMixin Private

Included in:
Qonfig::Validator::Predefined
Defined in:
lib/qonfig/validator/predefined/registry_control_mixin.rb

Overview

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

Since:

  • 0.13.0

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#registryQonfig::Validator::Predefined::Registry (readonly)

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



21
22
23
# File 'lib/qonfig/validator/predefined/registry_control_mixin.rb', line 21

def registry
  @registry
end

Class Method Details

.extended(basic_klass) ⇒ 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.13.0



12
13
14
# File 'lib/qonfig/validator/predefined/registry_control_mixin.rb', line 12

def extended(basic_klass)
  basic_klass.instance_variable_set(:@registry, Qonfig::Validator::Predefined::Registry.new)
end

Instance Method Details

#build(name, setting_key_matcher, strict) ⇒ Qonfig::Validator::Predefined::Common

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



40
41
42
43
# File 'lib/qonfig/validator/predefined/registry_control_mixin.rb', line 40

def build(name, setting_key_matcher, strict)
  validation = registry.resolve(name)
  Qonfig::Validator::Predefined::Common.new(setting_key_matcher, strict, validation)
end

#predefine(name, &validation) ⇒ 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.13.0



29
30
31
# File 'lib/qonfig/validator/predefined/registry_control_mixin.rb', line 29

def predefine(name, &validation)
  registry.register(name, &validation)
end