MooseX::Types::Moose::MutualCoercion is a Perl module that packages several Moose::Util::TypeConstraints with coercions, designed to mutually coerce with the built-in and common types known to Moose.
SYNOPSIS
{
package Foo;
use Moose;
use MooseX::Types::Moose::MutualCoercion
qw(StrToArrayRef ArrayRefToHashKeys);
has 'thingies' =>
(is => 'rw', isa => StrToArrayRef, coerce => 1);
has 'lookup_table' =>
(is => 'rw', isa => ArrayRefToHashKeys, coerce => 1);
1;
}
my $foo = Foo->new( thingies => 'bar' );
print $foo->thingies->[0]; # 'bar'
$foo->lookup_table( [qw(baz qux)] );
print 'eureka!' # 'eureka!'
if grep {
exists $foo->lookup_table->{$_};
} qw(foo bar baz);
Product's homepage
Requirements:
· Perl