Module: Cuprum::Collections::Adaptable::Commands::AbstractValidateOne
- Includes:
- ParameterValidation
- Defined in:
- lib/cuprum/collections/adaptable/commands/abstract_validate_one.rb
Overview
Abstract, adaptable implementation of the ValidateOne command.
Instance Method Summary collapse
-
#call(entity:, contract: nil) ⇒ Cuprum::Result<Hash>
Validates the entity against the given or default contract.
Instance Method Details
#call(entity:, contract: nil) ⇒ Cuprum::Result<Hash>
Validates the entity against the given or default contract.
If the entity matches the contract, #call will return a passing result with the entity as the result value. If the entity does not match the contract, #call will return a failing result with a FailedValidation error and the validation errors.
26 |
# File 'lib/cuprum/collections/adaptable/commands/abstract_validate_one.rb', line 26 validate :contract, Stannum::Constraints::Base, optional: true |