MouseX::Types::Path::Class(3pm)

MouseX::Types::Path::Class3pm

A path::class type library for mouse

Usage

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,
  );

Overview

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 "Str" and "ArrayRef" to both Path::Class::Dir and Path::Class::File objects. If you have MouseX::Getopt installed, the Getopt option type ("=s") will be added for both Path::Class::Dir and Path::Class::File.

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.

Thanks to

"AUTHOR" in MooseX::Types::Path::Class

Releases

7 releases since Debian 7 (Wheezy); the text changed 1 time.

  1. 7–10
  2. 11–13

Author

NAKAGAWA Masaki <[email protected]>

License

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

From libmousex-types-path-class-perl 0.07-1.1 in Debian 13 (Trixie). Parsed by carta from the page's man source.