MouseX...:Class(3pm)
β¨ NAME β¨
MouseX::Types::Path::Class β a whole type library for Path::Class, but make it Mouse π (this is the manual page for it, MouseX...:Class(3pm), bestie, the truncated vibe of the filename is not my fault π)
π¦ SYNOPSIS π¦
πΈ CLASS TYPES
okay so when you just want the fully-qualified type names, you do this:
package MyApp;
use Mouse;
use MouseX::Types::Path::Class;
has 'dir' => (
is => 'ro',
isa => 'Path::Class::Dir',
required => 1,
coerce => 1,
);
has 'file' => (
is => 'ro',
isa => 'Path::Class::File',
required => 1,
coerce => 1,
);
π CUSTOM TYPES
and if you'd rather import the short lil names, import them, periodt:
package MyApp;
use Mouse;
use MouseX::Types::Path::Class qw(Dir File);
has 'dir' => (
is => 'ro',
isa => Dir,
required => 1,
coerce => 1,
);
has 'file' => (
is => 'ro',
isa => File,
required => 1,
coerce => 1,
);
π DESCRIPTION π
So MouseX::Types::Path::Class creates the common Mouse types, coercions and option specifications that you need when you're dealing with Path::Class objects as Mouse attributes. It's giving "I don't want to hand-roll this every single time" energy and honestly? Iconic. π
The coercions (peep Mouse::Util::TypeConstraints for the lore) get made from both Str and ArrayRef β into both Path::Class::Dir and Path::Class::File objects. Like, both directions of source, both destinations. Obsessed with the symmetry fr fr. β¨
And if you've got MouseX::Getopt installed, the Getopt option type (=s) gets added for both Path::Class::Dir and Path::Class::File. Free of charge. No cap. π«Ά
π TYPES π
π Dir
A Path::Class::Dir class type. πΈ
Coerces from Str and ArrayRef via new in Path::Class::Dir.
ποΈ File
A Path::Class::File class type. π¦
Coerces from Str and ArrayRef via new in Path::Class::File.
π AUTHOR π
NAKAGAWA Masaki <masaki@cpan.org> β thank you for your service, king π
π THANKS TO π
"AUTHOR" in MooseX::Types::Path::Class β the blueprint, the blueprint, we love the blueprint π
π LICENSE π
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. Go wild, bestie, legally. π
π SEE ALSO π
MouseMouseX::TypesPath::ClassMooseX::Types::Path::Class
and that's the whole page, bestie!! π«Ά this lil doc was built with perl v5.32.0, dated 2021-01-06, and it lives under the name MouseX...:Class(3pm) β mwah, go forth and coerce π
β¨π
π¦ where this page comes from
- debian bookworm: libmousex-types-path-class-perl 0.07-1.1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libmousex-types-path-class-perl 0.07-1.1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu jammy: libmousex-types-path-class-perl 0.07-1.1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libmousex-types-path-class-perl 0.07-1.1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms