Class: SmartCore::Schema::Checker::Rules::Requirement::Optional Private
- Inherits:
-
Object
- Object
- SmartCore::Schema::Checker::Rules::Requirement::Optional
- Defined in:
- lib/smart_core/schema/checker/rules/requirement/optional.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.
Instance Method Summary collapse
- #initialize(rule) ⇒ void constructor private
- #validate(verifiable_hash) ⇒ SmartCore::Schema::Checker::Rules::Requirement::Result private
Constructor Details
#initialize(rule) ⇒ 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.
11 12 13 |
# File 'lib/smart_core/schema/checker/rules/requirement/optional.rb', line 11 def initialize(rule) @rule = rule end |
Instance Method Details
#validate(verifiable_hash) ⇒ SmartCore::Schema::Checker::Rules::Requirement::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.
20 21 22 23 24 25 26 27 |
# File 'lib/smart_core/schema/checker/rules/requirement/optional.rb', line 20 def validate(verifiable_hash) SmartCore::Schema::Checker::Rules::Requirement::Result.new( rule.schema_key, verifiable_hash, required: false, key_exists: verifiable_hash.key?(rule.schema_key) ) end |