MouseX...:Class(3pm)

πŸ“¦
version 0.07 Β· 4 versions
, in debian bookworm, debian trixie, ubuntu jammy, ubuntu noble

✨ 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 πŸ‘€

  • Mouse
  • MouseX::Types
  • Path::Class
  • MooseX::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