MooseX::Types::Locale::Country::Fast - Locale::Country related constraints for Moose (without coercions)


MooseX-Types-Locale-Country documentation  | view source Contained in the MooseX-Types-Locale-Country distribution.

Index


NAME

Top

MooseX::Types::Locale::Country::Fast - Locale::Country related constraints for Moose (without coercions)

VERSION

Top

This document describes MooseX::Types::Locale::Country::Fast version 0.04.

SYNOPSIS

Top

    {
        package Foo;

        use Moose;
        use MooseX::Types::Locale::Country qw(
            CountryCode
            Alpha2Country
            Alpha3Country
            NumericCountry
            CountryName
        );

        has 'code'
            => ( isa => CountryCode,    is => 'rw' );
        has 'alpha2'
            => ( isa => Alpha2Country,  is => 'rw' );
        has 'alpha3'
            => ( isa => Alpha3Country,  is => 'rw' );
        has 'numeric'
            => ( isa => NumericCountry, is => 'rw' );
        has 'name'
            => ( isa => CountryName,    is => 'rw' );

        __PACKAGE__->meta->make_immutable;
    }

    my $foo = Foo->new(
        code    => 'jp',
        alpha2  => 'jp',
        alpha3  => 'jpn',
        numeric => 392,
        name    => 'JAPAN',
    );
    print $foo->code;       # 'jp' (not 'JP')
    print $foo->alpha2;     # 'jp' (not 'JP')
    print $foo->alpha3;     # 'jpn' (not 'JPN')
    print $foo->numeric;    # 392
    print $foo->name;       # 'JAPAN' (not 'Japan')

DESCRIPTION

Top

This module packages several Moose::Util::TypeConstraints, designed to work with the values of Locale::Country.

This module does not provide you coercions. Therefore, it works faster than MooseX::Types::Locale::Country.

CONSTRAINTS

Top

Alpha2Country

A subtype of Str, which should be defined in country code of ISO 639-1 alpha-2.

CountryCode

Alias of Alpha2Country.

Alpha3Country

A subtype of Str, which should be defined in country code of ISO 3166-1 alpha-3.

NumericCountry

A subtype of Int, which should be defined in country code of ISO 3166-1 numeric.

CountryName

A subtype of Str, which should be defined in ISO 3166-1 country name.

NOTE

Top

The type mapping of MooseX::Getopt

This module provides the optional type mapping of MooseX::Getopt when MooseX::Getopt was installed.

CountryCode, Alpha2Country, Alpha3Country and CountryName are String ("=s") type.

NumericCountry is Int ("=i") type.

SEE ALSO

Top

* Locale::Country
* MooseX::Types::Locale::Country
* MooseX::Types::Locale::Language::Fast

INCOMPATIBILITIES

Top

None reported.

BUGS AND LIMITATIONS

Top

No bugs have been reported.

Making suggestions and reporting bugs

Please report any found bugs, feature requests, and ideas for improvements to bug-moosex-types-locale-Country at rt.cpan.org, or through the web interface at http://rt.cpan.org/Public/Bug/Report.html?Queue=MooseX-Types-Locale-Country. I will be notified, and then you'll automatically be notified of progress on your bugs/requests as I make changes.

When reporting bugs, if possible, please add as small a sample as you can make of the code that produces the bug. And of course, suggestions and patches are welcome.

SUPPORT

Top

You can find documentation for this module with the perldoc command.

    perldoc MooseX::Types::Locale::Country::Fast

You can also look for information at:

RT: CPAN's request tracker

http://rt.cpan.org/Public/Dist/Display.html?Name=MooseX-Types-Locale-Country

AnnoCPAN: Annotated CPAN documentation

http://annocpan.org/dist/MooseX-Types-Locale-Country

Search CPAN

http://search.cpan.org/dist/MooseX-Types-Locale-Country

CPAN Ratings

http://cpanratings.perl.org/dist/MooseX-Types-Locale-Country

VERSION CONTROL

Top

This module is maintained using git. You can get the latest version from git://github.com/gardejo/p5-moosex-types-locale-Country.git.

AUTHOR

Top

MORIYA Masaki, alias Gardejo

<moriya at cpan dot org>, http://gardejo.org/

COPYRIGHT AND LICENSE

Top


MooseX-Types-Locale-Country documentation  | view source Contained in the MooseX-Types-Locale-Country distribution.