Module: Types

Defined in:
lib/game_validator.rb

Constant Summary collapse

Callable =
Types.Constructor(Method) do |value|
  callable.call(value) # raises Dry::Types::ConstraintError if object doesn't respond to #call
  value.is_a?(Method) || value.is_a?(Proc) ? value : value.method(:call)
end
ArrayOfCallable =
Types::Array::of(Types::Callable)
ArrayOfStrictInteger =
Types::Array::of(Types::Strict::Integer)
ArrayOfString =
Types::Array::of(Types::String)
CoercibleNonnegativeInteger =
Types::Coercible::Integer.constrained(gteq: 0)