📝 Import Dry.Types, not Dry::Types
This commit is contained in:
parent
36aed854bf
commit
a47c4b5149
|
@ -7,7 +7,7 @@ require "dry/types"
|
||||||
Dry::Types.load_extensions(:maybe)
|
Dry::Types.load_extensions(:maybe)
|
||||||
|
|
||||||
module Types
|
module Types
|
||||||
include Dry::Types()
|
include Dry.Types()
|
||||||
end
|
end
|
||||||
|
|
||||||
begin
|
begin
|
||||||
|
|
|
@ -180,7 +180,7 @@ module Dry
|
||||||
#
|
#
|
||||||
# module Types
|
# module Types
|
||||||
# # imports all types as constants, uses modules for namespaces
|
# # imports all types as constants, uses modules for namespaces
|
||||||
# include Dry::Types()
|
# include Dry.Types()
|
||||||
# end
|
# end
|
||||||
# # strict types are exported by default
|
# # strict types are exported by default
|
||||||
# Types::Integer
|
# Types::Integer
|
||||||
|
@ -191,7 +191,7 @@ module Dry
|
||||||
# @example changing default types
|
# @example changing default types
|
||||||
#
|
#
|
||||||
# module Types
|
# module Types
|
||||||
# include Dry::Types(default: :nominal)
|
# include Dry.Types(default: :nominal)
|
||||||
# end
|
# end
|
||||||
# Types::Integer
|
# Types::Integer
|
||||||
# # => #<Dry::Types[Nominal<Integer>]>
|
# # => #<Dry::Types[Nominal<Integer>]>
|
||||||
|
@ -199,7 +199,7 @@ module Dry
|
||||||
# @example cherry-picking namespaces
|
# @example cherry-picking namespaces
|
||||||
#
|
#
|
||||||
# module Types
|
# module Types
|
||||||
# include Dry::Types(:strict, :coercible)
|
# include Dry.Types(:strict, :coercible)
|
||||||
# end
|
# end
|
||||||
# # cherry-picking discards default types,
|
# # cherry-picking discards default types,
|
||||||
# # provide the :default option along with the list of
|
# # provide the :default option along with the list of
|
||||||
|
@ -208,7 +208,7 @@ module Dry
|
||||||
#
|
#
|
||||||
# @example custom names
|
# @example custom names
|
||||||
# module Types
|
# module Types
|
||||||
# include Dry::Types(coercible: :Kernel)
|
# include Dry.Types(coercible: :Kernel)
|
||||||
# end
|
# end
|
||||||
# Types::Kernel::Integer
|
# Types::Kernel::Integer
|
||||||
# # => #<Dry::Types[Constructor<Nominal<Integer> fn=Kernel.Integer>]>
|
# # => #<Dry::Types[Constructor<Nominal<Integer> fn=Kernel.Integer>]>
|
||||||
|
|
|
@ -8,7 +8,7 @@ module Dry
|
||||||
# Export types registered in a container as module constants.
|
# Export types registered in a container as module constants.
|
||||||
# @example
|
# @example
|
||||||
# module Types
|
# module Types
|
||||||
# include Dry::Types(:strict, :coercible, :nominal, default: :strict)
|
# include Dry.Types(:strict, :coercible, :nominal, default: :strict)
|
||||||
# end
|
# end
|
||||||
#
|
#
|
||||||
# Types.constants
|
# Types.constants
|
||||||
|
|
Loading…
Reference in New Issue