1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93
|
# NAME
MouseX::Types::Path::Class - A Path::Class type library for Mouse
# SYNOPSIS
## CLASS TYPES
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
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
MouseX::Types::Path::Class creates common [Mouse](http://search.cpan.org/perldoc?Mouse) types,
coercions and option specifications useful for dealing
with [Path::Class](http://search.cpan.org/perldoc?Path::Class) objects as [Mouse](http://search.cpan.org/perldoc?Mouse) attributes.
Coercions (see [Mouse::Util::TypeConstraints](http://search.cpan.org/perldoc?Mouse::Util::TypeConstraints)) are made
from both `Str` and `ArrayRef` to both [Path::Class::Dir](http://search.cpan.org/perldoc?Path::Class::Dir) and
[Path::Class::File](http://search.cpan.org/perldoc?Path::Class::File) objects.
If you have [MouseX::Getopt](http://search.cpan.org/perldoc?MouseX::Getopt) installed,
the Getopt option type ("=s") will be added for both
[Path::Class::Dir](http://search.cpan.org/perldoc?Path::Class::Dir) and [Path::Class::File](http://search.cpan.org/perldoc?Path::Class::File).
# TYPES
## Dir
A [Path::Class::Dir](http://search.cpan.org/perldoc?Path::Class::Dir) class type.
Coerces from `Str` and `ArrayRef` via ["new" in Path::Class::Dir](http://search.cpan.org/perldoc?Path::Class::Dir#new).
## File
A [Path::Class::File](http://search.cpan.org/perldoc?Path::Class::File) class type.
Coerces from `Str` and `ArrayRef` via ["new" in Path::Class::File](http://search.cpan.org/perldoc?Path::Class::File#new).
# AUTHOR
NAKAGAWA Masaki <masaki@cpan.org>
# THANKS TO
["AUTHOR" in MooseX::Types::Path::Class](http://search.cpan.org/perldoc?MooseX::Types::Path::Class#AUTHOR)
# LICENSE
This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself.
# SEE ALSO
[Mouse](http://search.cpan.org/perldoc?Mouse), [MouseX::Types](http://search.cpan.org/perldoc?MouseX::Types),
[Path::Class](http://search.cpan.org/perldoc?Path::Class),
[MooseX::Types::Path::Class](http://search.cpan.org/perldoc?MooseX::Types::Path::Class)
|