line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package MooseX::Types::Locale::BR; |
2
|
1
|
|
|
1
|
|
28458
|
use strict; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
43
|
|
3
|
1
|
|
|
1
|
|
449
|
use MooseX::Types -declare => [qw/State Code/]; |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
use MooseX::Types::Common::String 'NonEmptySimpleStr'; |
5
|
|
|
|
|
|
|
use Locale::BR qw(); |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our $VERSION = '0.01'; |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
subtype State, |
10
|
|
|
|
|
|
|
as NonEmptySimpleStr, |
11
|
|
|
|
|
|
|
where { Locale::BR::state2code($_) ? 1 : 0 }, |
12
|
|
|
|
|
|
|
message { "Must be a valid state" }; |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
subtype Code, |
15
|
|
|
|
|
|
|
as NonEmptySimpleStr, |
16
|
|
|
|
|
|
|
where { Locale::BR::code2state($_) ? 1 : 0 }, |
17
|
|
|
|
|
|
|
message { "Must be a valid state's code" }; |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
42; |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
__END__ |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
=head1 NAME |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
MooseX::Types::Locale::BR - Brazilian locale validation type constraint for Moose. |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
=head1 SYNOPSIS |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
package MyClass; |
31
|
|
|
|
|
|
|
use Moose; |
32
|
|
|
|
|
|
|
use MooseX::Types::Locale::BR; |
33
|
|
|
|
|
|
|
use namespace::autoclean; |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
has state => ( is => 'rw', isa => 'MooseX::Types::Locale::BR::State' ); |
36
|
|
|
|
|
|
|
has code => ( is => 'rw', isa => 'MooseX::Types::Locale::BR::Code' ); |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
package main; |
39
|
|
|
|
|
|
|
MyClass->new( state=> 'Acre', code => 'AC'); |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
=head1 DESCRIPTION |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
Moose type constraints wich use L<Locale::BR> to check |
45
|
|
|
|
|
|
|
brazilian locale. |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
=head1 SEE ALSO |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
=over |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
=item L<Moose::Util::TypeConstraints> |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
=item L<MooseX::Types> |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
=item L<Locale::BR> |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
=back |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
=head1 AUTHOR |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
Solli M. Honorio, C<< <shonorio at gmail.com> >> |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
=head1 BUGS |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
Please report any bugs or feature requests to C<bug-moosex-types-locale-br at rt.cpan.org>, or through |
69
|
|
|
|
|
|
|
the web interface at L<http://rt.cpan.org/NoAuth/ReportBug.html?Queue=MooseX-Types-Locale-BR>. I will be notified, and then you'll |
70
|
|
|
|
|
|
|
automatically be notified of progress on your bug as I make changes. |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
=head1 SUPPORT |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
You can find documentation for this module with the perldoc command. |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
perldoc MooseX::Types::Locale::BR |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
You can also look for information at: |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
=over 4 |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
=item * RT: CPAN's request tracker |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
L<http://rt.cpan.org/NoAuth/Bugs.html?Dist=MooseX-Types-Locale-BR> |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
=item * AnnoCPAN: Annotated CPAN documentation |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
L<http://annocpan.org/dist/MooseX-Types-Locale-BR> |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
=item * CPAN Ratings |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
L<http://cpanratings.perl.org/d/MooseX-Types-Locale-BR> |
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
=item * Search CPAN |
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
L<http://search.cpan.org/dist/MooseX-Types-Locale-BR/> |
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
=back |
103
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
=head1 ACKNOWLEDGEMENTS |
106
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
=head1 LICENSE AND COPYRIGHT |
109
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
Copyright 2011 Solli M. Honorio. |
111
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify it |
113
|
|
|
|
|
|
|
under the terms of either: the GNU General Public License as published |
114
|
|
|
|
|
|
|
by the Free Software Foundation; or the Artistic License. |
115
|
|
|
|
|
|
|
|
116
|
|
|
|
|
|
|
See http://dev.perl.org/licenses/ for more information. |
117
|
|
|
|
|
|
|
|
118
|
|
|
|
|
|
|
|
119
|
|
|
|
|
|
|
=cut |