Sha256: f186f82627a2b34a957c037f9628da9bb9077ef27074516d043a4783aab86f13

Contents?: true

Size: 524 Bytes

Versions: 9

Compression:

Stored size: 524 Bytes

Contents

module Dry
  module Types
    Any = Class.new(Definition) do
      def initialize(**options)
        super(::Object, options)
      end

      # @return [String]
      def name
        'Any'
      end

      # @param [Object] any input is valid
      # @return [true]
      def valid?(_)
        true
      end
      alias_method :===, :valid?

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

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
dry-types-0.14.1 lib/dry/types/any.rb
dry-types-0.14.0 lib/dry/types/any.rb
dry-types-0.13.4 lib/dry/types/any.rb
dry-types-0.13.3 lib/dry/types/any.rb
dry-types-0.12.3 lib/dry/types/any.rb
dry-types-0.13.2 lib/dry/types/any.rb
dry-types-0.13.1 lib/dry/types/any.rb
dry-types-0.13.0 lib/dry/types/any.rb
dry-types-0.12.2 lib/dry/types/any.rb