Module: SmartCore::Schema::Checker::Rules::Verifier Private

Defined in:
lib/smart_core/schema/checker/rules/verifier.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.1.0

Version:

  • 0.3.0

API:

  • private

Defined Under Namespace

Classes: Result

Class Method Summary collapse

Class Method Details

.verify!(rule, matcher_options, verifiable_hash) ⇒ SmartCore::Schema::Checker::Rules::Verifier::Result

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:

Returns:

Since:

  • 0.1.0

Version:

  • 0.3.0

API:

  • private



18
19
20
21
22
23
24
25
26
27
# File 'lib/smart_core/schema/checker/rules/verifier.rb', line 18

def verify!(rule, matcher_options, verifiable_hash)
  SmartCore::Schema::Checker::Rules::Verifier::Result.new(rule).tap do |result|
    requirement = result << check_requirement(rule, verifiable_hash)
    next result if requirement.required? && requirement.failure?
    next result if requirement.optional? && requirement.success? && !requirement.key_exists?
    result << check_type(rule, verifiable_hash)
    filled = result << check_filled(rule, verifiable_hash)
    result << check_nested(rule, verifiable_hash) if filled.success?
  end
end