Sha256: bc1e5573c768e318c0fbd1ab11baa8dcd8ae9538bd70a6d6bd7c3d63807d1529

Contents?: true

Size: 582 Bytes

Versions: 20

Compression:

Stored size: 582 Bytes

Contents

# frozen_string_literal: true

module Dry
  module Types
    # Common API for types with options
    #
    # @api private
    module Options
      # @return [Hash]
      attr_reader :options

      # @see Nominal#initialize
      #
      # @api private
      def initialize(*args, **options)
        @__args__ = args.freeze
        @options = options.freeze
      end

      # @param [Hash] new_options
      #
      # @return [Type]
      #
      # @api private
      def with(**new_options)
        self.class.new(*@__args__, **options, **new_options)
      end
    end
  end
end

Version data entries

20 entries across 20 versions & 2 rubygems

Version Path
dry-types-1.8.1 lib/dry/types/options.rb
dry-types-1.8.0 lib/dry/types/options.rb
dry-types-1.7.2 lib/dry/types/options.rb
dry-types-1.7.1 lib/dry/types/options.rb
dry-types-1.7.0 lib/dry/types/options.rb
dry-types-1.6.1 lib/dry/types/options.rb
dry-types-1.6.0 lib/dry/types/options.rb
dry-types-1.5.1 lib/dry/types/options.rb
dry-types-1.5.0 lib/dry/types/options.rb
grape-extra_validators-2.0.0 vendor/bundle/ruby/2.6.0/gems/dry-types-1.4.0/lib/dry/types/options.rb
dry-types-1.4.0 lib/dry/types/options.rb
dry-types-1.3.1 lib/dry/types/options.rb
dry-types-1.3.0 lib/dry/types/options.rb
dry-types-1.2.2 lib/dry/types/options.rb
dry-types-1.2.1 lib/dry/types/options.rb
dry-types-1.2.0 lib/dry/types/options.rb
dry-types-1.1.1 lib/dry/types/options.rb
dry-types-1.1.0 lib/dry/types/options.rb
dry-types-1.0.1 lib/dry/types/options.rb
dry-types-1.0.0 lib/dry/types/options.rb