Module: SmartCore::Schema::Checker::Reconciler::Constructor Private
- Defined in:
- lib/smart_core/schema/checker/reconciler/constructor.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.
Constant Summary collapse
- STRICT_MODES =
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.
{ strict: true, 'strict' => true, non_strict: false, 'non_strict' => true }.freeze
- DEFAULT_STRICT_BEHAVIOR =
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.
STRICT_MODES[:strict]
Class Method Summary collapse
- .append_definitions(reconciler, &definitions) ⇒ void private
- .create(&definitions) ⇒ SmarCore::Schema::Checker::Reconciler private
- .set_strict_mode(reconciler, strict_mode) ⇒ void private
Class Method Details
.append_definitions(reconciler, &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.
26 27 28 |
# File 'lib/smart_core/schema/checker/reconciler/constructor.rb', line 26 def append_definitions(reconciler, &definitions) reconciler.instance_eval(&definitions) end |
.create(&definitions) ⇒ SmarCore::Schema::Checker::Reconciler
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.
54 55 56 57 58 |
# File 'lib/smart_core/schema/checker/reconciler/constructor.rb', line 54 def create(&definitions) SmartCore::Schema::Checker::Reconciler.new.tap do |reconciler| append_definitions(reconciler, &definitions) if block_given? end end |
.set_strict_mode(reconciler, 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.
36 37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/smart_core/schema/checker/reconciler/constructor.rb', line 36 def set_strict_mode(reconciler, strict_mode) return if strict_mode == nil is_strict = STRICT_MODES.fetch(strict_mode) do raise(SmartCore::Schema::ArgumentError, <<~ERROR_MESSAGE) Unsupported strict mode "#{strict_mode}". SmartCore::Schema supports "strict" and "non_strict" modes only. ERROR_MESSAGE end reconciler.strict!(is_strict) end |