Module: Hanami::Validations::ClassMethods Private
- Defined in:
- lib/hanami/validations.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.
Validations DSL
Instance Method Summary collapse
- #_validator ⇒ Object private
-
#validations(&blk) ⇒ Object
private
Define validation rules from the given block.
Instance Method Details
#_validator ⇒ Object
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.
71 72 73 |
# File 'lib/hanami/validations.rb', line 71 def _validator @_validator end |
#validations(&blk) ⇒ Object
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.
Define validation rules from the given block.
65 66 67 |
# File 'lib/hanami/validations.rb', line 65 def validations(&blk) @_validator = Dry::Validation::Contract.build { schema(&blk) } end |