Despite the abstract for this module, LoadableClass doesn't actually have a coercion, so no need to use coerce => 1 on the attribute. Rather, the class gets loaded as a side-effect of checking that it's loadable.

Type Constraints

A subtype of ModuleName that names a module which is either already loaded (according to Class::Load), or can be loaded (by Class::Load).

LoadableRole

A subtype of LoadableClass that names a module which appears to be a role rather than a class.

(Because this type constraint is designed to work with Moose, Mouse, Moo, or none of the above, it can't rely on the features of any particular implementation of roles. Therefore is needs to use a heuristic to detect whether a loaded package represents a role or not. Curently this heuristic is the absence of a method named new.)

ClassIsa[`a]

A subtype of LoadableClass which checks that the class is a subclass of a given base class:

ClassIsa["MyApp::Plugin"]

Multiple base classes may be provided. A class only needs to satisfy one isa to pass the type constraint check.

ClassIsa["MyApp::Plugin", "YourApp::Plugin"]

ClassDoes[`a]

A subtype of LoadableClass which checks that the class performs a given role. (This uses "DOES" in UNIVERSAL.) If multiple roles are given, the class must perform all of them.

ClassDoes["MyApp::Role::Loadable", "MyApp::Role::Dumpable"]

ClassCan[`a]

A subtype of LoadableClass which checks that the class provides particular methods:

ClassCan[ qw( new load dump ) ]

Type Coercions

The following named coercion can be exported:

ExpandPrefix[`a]

A coercion to expand class name abbreviations starting with a dash using a given prefix.