# 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/search?mode=module&query=Mouse) types,
coercions and option specifications useful for dealing
with [Path::Class](http://search.cpan.org/search?mode=module&query=Path::Class) objects as [Mouse](http://search.cpan.org/search?mode=module&query=Mouse) attributes.

Coercions (see [Mouse::Util::TypeConstraints](http://search.cpan.org/search?mode=module&query=Mouse::Util::TypeConstraints)) are made
from both `Str` and `ArrayRef` to both [Path::Class::Dir](http://search.cpan.org/search?mode=module&query=Path::Class::Dir) and
[Path::Class::File](http://search.cpan.org/search?mode=module&query=Path::Class::File) objects.
If you have [MouseX::Getopt](http://search.cpan.org/search?mode=module&query=MouseX::Getopt) installed,
the Getopt option type ("=s") will be added for both
[Path::Class::Dir](http://search.cpan.org/search?mode=module&query=Path::Class::Dir) and [Path::Class::File](http://search.cpan.org/search?mode=module&query=Path::Class::File).

# TYPES

## Dir

A [Path::Class::Dir](http://search.cpan.org/search?mode=module&query=Path::Class::Dir) class type.

Coerces from `Str` and `ArrayRef` via L<Path::Class::Dir/new>.

## File

A [Path::Class::File](http://search.cpan.org/search?mode=module&query=Path::Class::File) class type.

Coerces from `Str` and `ArrayRef` via L<Path::Class::File/new>.

# AUTHOR

NAKAGAWA Masaki <masaki@cpan.org>

# THANKS TO

L<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/search?mode=module&query=Mouse), [MouseX::Types](http://search.cpan.org/search?mode=module&query=MouseX::Types),

[Path::Class](http://search.cpan.org/search?mode=module&query=Path::Class),

[MooseX::Types::Path::Class](http://search.cpan.org/search?mode=module&query=MooseX::Types::Path::Class)