NAME

Types::Dist - Types related to distributions (e.g. distributions on CPAN)

VERSION

version 0.09

TYPES

DistFQ

DistName-DistVersion

package MyClass;

use Moo;
use Types::Dist qw(DistName);

has dist => ( is => 'ro', isa => DistName );

1;

And then use your class:

my $object   = MyClass->new( dist => 'Types-RENEEB-0.09' );
my $object   = MyClass->new( dist => '0.09' );         # fails
my $object   = MyClass->new( dist => 'Types-RENEEB' ); # fails

DistName

A name of a distribution

my $object   = MyClass->new( dist => 'Types-RENEEB' ); # ok

DistVersion

A version of a distribution

my $object   = MyClass->new( dist => '0.09' ); # ok

CPANfile

An instance of Module::CPANfile

package MyClass;

use Moo;
use Types::Dist qw(CPANfile);

has prereqs => ( is => 'ro', isa => CPANfile, coerce => 1 );

1;

And then use your class:

my $object   = MyClass->new( prereqs => '/path/to/cpanfile' );
my @features = $object->prereqs->features; # call features method from Module::CPANfile

AUTHOR

Renee Baecker <reneeb@cpan.org>

COPYRIGHT AND LICENSE

This software is Copyright (c) 2019 by Renee Baecker.

This is free software, licensed under:

The Artistic License 2.0 (GPL Compatible)