A path::class type library for mouse
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, );
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, );
MouseX::Types::Path::Class creates common Mouse types, coercions and option specifications useful for dealing with Path::Class objects as Mouse attributes.
Coercions (see Mouse::Util::TypeConstraints) are made from both \*(C`Str\*(C' and \*(C`ArrayRef\*(C' to both Path::Class::Dir and Path::Class::File objects. If you have MouseX::Getopt installed, the Getopt option type (\*(L"=s\*(R") will be added for both Path::Class::Dir and Path::Class::File.
A Path::Class::Dir class type. Coerces from \*(C`Str\*(C' and \*(C`ArrayRef\*(C' via \*(L"new\*(R" in Path::Class::Dir.
A Path::Class::File class type. Coerces from \*(C`Str\*(C' and \*(C`ArrayRef\*(C' via \*(L"new\*(R" in Path::Class::File.
\s-1NAKAGAWA\s0 Masaki <[email protected]>
\*(L"\s-1AUTHOR\s0\*(R" in MooseX::Types::Path::Class
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Mouse, MouseX::Types,
Path::Class,
MooseX::Types::Path::Class