Sha256: ba7b0514cfa44cfd6ed9500befbc609fd0f9b1d71f07fd992e849b7273a08efd

Contents?: true

Size: 1.26 KB

Versions: 13

Compression:

Stored size: 1.26 KB

Contents

# frozen_string_literal: true

require "dry/schema/compiler"
require "dry/schema/message"
require "dry/schema/message_compiler"

require "dry/schema/extensions/hints/compiler_methods"
require "dry/schema/extensions/hints/message_compiler_methods"
require "dry/schema/extensions/hints/message_set_methods"
require "dry/schema/extensions/hints/result_methods"

module Dry
  module Schema
    # Hint-specific Message extensions
    #
    # @see Message
    #
    # @api public
    class Message
      # Hints extension for Or messages
      #
      # @see Message::Or
      #
      # @api public
      class Or::SinglePath
        # @api private
        def hint?
          false
        end
      end

      class Or::MultiPath
        # @api private
        def hint?
          false
        end
      end

      # @api private
      def hint?
        false
      end
    end

    # A hint message sub-type
    #
    # @api private
    class Hint < Message
      # @api private
      def hint?
        true
      end
    end

    # Hints extensions
    module Extensions
      Compiler.prepend(Hints::CompilerMethods)
      MessageCompiler.prepend(Hints::MessageCompilerMethods)
      MessageSet.prepend(Hints::MessageSetMethods)
      Result.prepend(Hints::ResultMethods)
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
dry-schema-1.8.0 lib/dry/schema/extensions/hints.rb
dry-schema-1.7.1 lib/dry/schema/extensions/hints.rb
dry-schema-1.7.0 lib/dry/schema/extensions/hints.rb
dry-schema-1.6.2 lib/dry/schema/extensions/hints.rb
dry-schema-1.6.1 lib/dry/schema/extensions/hints.rb
dry-schema-1.6.0 lib/dry/schema/extensions/hints.rb
dry-schema-1.5.6 lib/dry/schema/extensions/hints.rb
dry-schema-1.5.5 lib/dry/schema/extensions/hints.rb
dry-schema-1.5.4 lib/dry/schema/extensions/hints.rb
dry-schema-1.5.3 lib/dry/schema/extensions/hints.rb
dry-schema-1.5.2 lib/dry/schema/extensions/hints.rb
dry-schema-1.5.1 lib/dry/schema/extensions/hints.rb
dry-schema-1.5.0 lib/dry/schema/extensions/hints.rb