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

Since:

  • 0.1.0

API:

  • private

Instance Method Summary collapse

Instance Method Details

#_validatorObject

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.

Since:

  • 2.0.0

API:

  • private



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.

Parameters:

  • validation rules

Since:

  • 0.6.0

API:

  • private



65
66
67
# File 'lib/hanami/validations.rb', line 65

def validations(&blk)
  @_validator = Dry::Validation::Contract.build { schema(&blk) }
end