Module: Dry::Schema::Extensions::Hints::ResultMethods

Included in:
Result
Defined in:
lib/dry/schema/extensions/hints/result_methods.rb

Overview

Get errors exclusively without hints

Instance Method Summary collapse

Instance Method Details

#errors(options = EMPTY_HASH) ⇒ MessageSet

Return error messages exclusively

Returns:

See Also:



18
19
20
# File 'lib/dry/schema/extensions/hints/result_methods.rb', line 18

def errors(options = EMPTY_HASH)
  message_set(options.merge(hints: false))
end

#hints(options = EMPTY_HASH) ⇒ MessageSet

Get hints exclusively without errors

Returns:

See Also:

  • #message_set


40
41
42
# File 'lib/dry/schema/extensions/hints/result_methods.rb', line 40

def hints(options = EMPTY_HASH)
  message_set(options.merge(failures: false))
end

#messages(options = EMPTY_HASH) ⇒ MessageSet

Get all messages including hints

Returns:

See Also:

  • #message_set


29
30
31
# File 'lib/dry/schema/extensions/hints/result_methods.rb', line 29

def messages(options = EMPTY_HASH)
  message_set(options)
end