Sha256: f60888bc38daeb1ed44dd7acc1e2cef4848840356a5cf2c8286c86e3e2799496

Contents?: true

Size: 1.05 KB

Versions: 47

Compression:

Stored size: 1.05 KB

Contents

# frozen_string_literal: true

module Dry
  module Schema
    module Extensions
      module Hints
        # Get errors exclusively without hints
        #
        # @api public
        module ResultMethods
          # Return error messages exclusively
          #
          # @see Result#errors
          #
          # @return [MessageSet]
          #
          # @api public
          def errors(options = EMPTY_HASH)
            message_set(options.merge(hints: false))
          end

          # Get all messages including hints
          #
          # @see #message_set
          #
          # @return [MessageSet]
          #
          # @api public
          def messages(options = EMPTY_HASH)
            message_set(options)
          end

          # Get hints exclusively without errors
          #
          # @see #message_set
          #
          # @return [MessageSet]
          #
          # @api public
          def hints(options = EMPTY_HASH)
            message_set(options.merge(failures: false))
          end
        end
      end
    end
  end
end

Version data entries

47 entries across 47 versions & 1 rubygems

Version Path
dry-schema-1.13.3 lib/dry/schema/extensions/hints/result_methods.rb
dry-schema-1.13.2 lib/dry/schema/extensions/hints/result_methods.rb
dry-schema-1.13.1 lib/dry/schema/extensions/hints/result_methods.rb
dry-schema-1.13.0 lib/dry/schema/extensions/hints/result_methods.rb
dry-schema-1.12.0 lib/dry/schema/extensions/hints/result_methods.rb
dry-schema-1.11.3 lib/dry/schema/extensions/hints/result_methods.rb
dry-schema-1.11.2 lib/dry/schema/extensions/hints/result_methods.rb
dry-schema-1.11.1 lib/dry/schema/extensions/hints/result_methods.rb
dry-schema-1.11.0 lib/dry/schema/extensions/hints/result_methods.rb
dry-schema-1.10.6 lib/dry/schema/extensions/hints/result_methods.rb
dry-schema-1.10.5 lib/dry/schema/extensions/hints/result_methods.rb
dry-schema-1.10.4 lib/dry/schema/extensions/hints/result_methods.rb
dry-schema-1.10.3 lib/dry/schema/extensions/hints/result_methods.rb
dry-schema-1.10.2 lib/dry/schema/extensions/hints/result_methods.rb
dry-schema-1.10.1 lib/dry/schema/extensions/hints/result_methods.rb
dry-schema-1.9.3 lib/dry/schema/extensions/hints/result_methods.rb
dry-schema-1.9.2 lib/dry/schema/extensions/hints/result_methods.rb
dry-schema-1.9.1 lib/dry/schema/extensions/hints/result_methods.rb
dry-schema-1.9.0 lib/dry/schema/extensions/hints/result_methods.rb
dry-schema-1.8.0 lib/dry/schema/extensions/hints/result_methods.rb