API-MailboxOrg

 view release on metacpan or  search on metacpan

lib/API/MailboxOrg/Types.pm  view on Meta::CPAN

=head1 SYNOPSIS

    {
        package  # private package - do not index
            TestClass;

        use Moo;
        use API::MailboxOrg::Types qw(Boolean HashRefRestricted);

        has true_or_false => ( is => 'ro', isa => Boolean, coerce => 1 );
        has map           => ( is => 'ro', isa => HashRefRestricted[qw(a b)] ); # allow only keys a and b

        1;
    }

    my $obj = TestClass->new(
        true_or_false => 1,  # 0|1|""|undef|JSON::PP::Boolean object
        map  => {
            a => 1,
            b => 1,
            # a key 'c' would cause a 'die'

 view all matches for this distribution
 view release on metacpan -  search on metacpan

( run in 2.052 seconds using v1.00-cache-2.02-grep-82fe00e-cpan-f5108d614456 )