module Dry::Validation::Hints::ResultExtensions

Hints extensions for Result

@api public

Public Instance Methods

errors(new_options = EMPTY_HASH) click to toggle source

Return error messages excluding hints

@macro errors-options @return [MessageSet]

@api public

# File lib/dry/validation/extensions/hints.rb, line 34
def errors(new_options = EMPTY_HASH)
  opts = new_options.merge(hints: false)
  @errors.with(schema_errors(opts), opts)
end
hints(new_options = EMPTY_HASH) click to toggle source

Return hint messages

@macro errors-options

@return [MessageSet]

@api public

# File lib/dry/validation/extensions/hints.rb, line 57
def hints(new_options = EMPTY_HASH)
  schema_result.hints(new_options)
end
messages(new_options = EMPTY_HASH) click to toggle source

Return errors and hints

@macro errors-options

@return [MessageSet]

@api public

# File lib/dry/validation/extensions/hints.rb, line 46
def messages(new_options = EMPTY_HASH)
  errors.with(hints(new_options).to_a, options.merge(**new_options))
end