Module: Dry::Validation::Hints::ResultExtensions
- Included in:
- Result
- Defined in:
- lib/dry/validation/extensions/hints.rb
Overview
Hints extensions for Result
Instance Method Summary collapse
-
#errors(new_options = EMPTY_HASH) ⇒ MessageSet
Return error messages excluding hints.
-
#hints(new_options = EMPTY_HASH) ⇒ MessageSet
Return hint messages.
-
#messages(new_options = EMPTY_HASH) ⇒ MessageSet
Return errors and hints.
Instance Method Details
#errors(new_options = EMPTY_HASH) ⇒ MessageSet
Return error messages excluding hints
34 35 36 37 |
# File 'lib/dry/validation/extensions/hints.rb', line 34 def errors( = EMPTY_HASH) opts = .merge(hints: false) @errors.with(schema_errors(opts), opts) end |
#hints(new_options = EMPTY_HASH) ⇒ MessageSet
Return hint messages
57 58 59 |
# File 'lib/dry/validation/extensions/hints.rb', line 57 def hints( = EMPTY_HASH) schema_result.hints() end |
#messages(new_options = EMPTY_HASH) ⇒ MessageSet
Return errors and hints
46 47 48 |
# File 'lib/dry/validation/extensions/hints.rb', line 46 def ( = EMPTY_HASH) errors.with(hints().to_a, .merge(**)) end |