Class: ObjectValidator::Checks::Keys
- Defined in:
- lib/object_validator/checks/keys.rb
Instance Attribute Summary
Attributes inherited from Base
#errors, #name, #object, #value
Instance Method Summary collapse
Methods inherited from Base
Constructor Details
This class inherits a constructor from ObjectValidator::Checks::Base
Instance Method Details
#call ⇒ Object
4 5 6 7 8 |
# File 'lib/object_validator/checks/keys.rb', line 4 def call return if method.is_a?(Hash) && value.each { |key| break false unless method.key?(key) } errors.add(name, 'does not contain required Hash keys') end |