Class: SmartCore::Schema::Checker Private
- Inherits:
-
Object
- Object
- SmartCore::Schema::Checker
- Defined in:
- lib/smart_core/schema/checker.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.
Defined Under Namespace
Classes: Reconciler, Rules, VerifiableHash
Instance Method Summary collapse
- #append_schema_definitions(&definitions) ⇒ void private
- #check!(verifiable_hash) ⇒ SmartCore::Schema::Result private
- #combine_with(another_checker) ⇒ SmartCore::Schema::Checker private
- #initialize ⇒ void constructor private
- #invoke_in_pipe(&checker_invokations) ⇒ void private
- #set_strict_mode(strict_mode) ⇒ void private
Constructor Details
#initialize ⇒ 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.
16 17 18 19 |
# File 'lib/smart_core/schema/checker.rb', line 16 def initialize @reconciler = Reconciler::Constructor.create @lock = SmartCore::Engine::ReadWriteLock.new end |
Instance Method Details
#append_schema_definitions(&definitions) ⇒ 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.
63 64 65 |
# File 'lib/smart_core/schema/checker.rb', line 63 def append_schema_definitions(&definitions) @lock.write_sync { add_schema_definitions(&definitions) } end |
#check!(verifiable_hash) ⇒ SmartCore::Schema::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.
27 28 29 30 31 32 33 34 35 |
# File 'lib/smart_core/schema/checker.rb', line 27 def check!(verifiable_hash) @lock.read_sync do raise(SmartCore::Schema::ArgumentError, <<~ERROR_MESSAGE) unless verifiable_hash.is_a?(Hash) Verifiable hash should be a type of ::Hash ERROR_MESSAGE reconciler.__match!(VerifiableHash.new(verifiable_hash)).complete! end end |
#combine_with(another_checker) ⇒ SmartCore::Schema::Checker
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.
73 74 75 |
# File 'lib/smart_core/schema/checker.rb', line 73 def combine_with(another_checker) @lock.write_sync { self } # TODO (0.x.0): merge the definitions and return self end |
#invoke_in_pipe(&checker_invokations) ⇒ 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.
43 44 45 |
# File 'lib/smart_core/schema/checker.rb', line 43 def invoke_in_pipe(&checker_invokations) @lock.write_sync { instance_eval(&checker_invokations) } end |
#set_strict_mode(strict_mode) ⇒ 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.
53 54 55 |
# File 'lib/smart_core/schema/checker.rb', line 53 def set_strict_mode(strict_mode) @lock.write_sync { apply_strict_mode(strict_mode) } end |