NAME

Devel::Ladybug::Subtype - Subtype rules for Devel::Ladybug::Type instances

DESCRIPTION

Subtypes are optional components which may modify the parameters of an Devel::Ladybug::Type. Subtypes are sent as arguments when calling Devel::Ladybug::Type constructors.

When you see something like:

foo => Devel::Ladybug::Str->assert(
  subtype(
    optional => true
  )
)

"Devel::Ladybug::Str->assert()" was the Type constructor, and "optional" was part of the Subtype specification. "foo" was name of the instance variable and database table column which was asserted.

The class variable %Devel::Ladybug::Type::RULES is walked at package load time, and the necessary rule subclasses are created dynamically.

See Devel::Ladybug::Type for a full list of available subtype args.

PUBLIC INSTANCE METHODS

  • $self->value()

    Return the scalar value which was provided to self's constructor.

SEE ALSO

Devel::Ladybug::Type

This file is part of Devel::Ladybug.