File Coverage

blib/lib/Data/Faker/Country.pm
Criterion Covered Total %
statement 24 24 100.0
branch n/a
condition n/a
subroutine 8 8 100.0
pod n/a
total 32 32 100.0


line stmt bran cond sub pod time code
1             package Data::Faker::Country;
2             # ABSTRACT: Provides country and ISO country code generation
3              
4 1     1   758 use strict;
  1     1   2  
  1         30  
  1         8006  
  1         2  
  1         32  
5 1     1   5 use warnings;
  1     1   1  
  1         51  
  1         6  
  1         2  
  1         52  
6              
7             =head1 NAME
8              
9             Data::Faker::Country - provides country support for L
10              
11             =head1 SYNOPSIS
12              
13             use Data::Faker;
14             use feature qw(say);
15             my $faker = Data::Faker->new;
16             say "Example country: " . $faker->country;
17             say "Example ISO country code: " . $faker->country_code;
18              
19             =head1 DESCRIPTION
20              
21             Provides two methods in L:
22              
23             =head1 METHODS
24              
25             =head2 country
26              
27             Returns a single scalar country name (in English) as a Unicode string.
28              
29             =head2 country_code
30              
31             Returns a single scalar 2-character ISO-3166 country code as a Unicode string.
32              
33             =cut
34              
35             our $VERSION = '0.001';
36              
37 1     1   414 use parent qw(Data::Faker);
  1     1   296  
  1         5  
  1         6  
  1         2  
  1         9  
38              
39 1     1   464 use Locale::Country;
  1     1   40177  
  1         105  
  1         64  
  1         2  
  1         129  
40              
41             __PACKAGE__->register_plugin(
42             country => [ Locale::Country::all_country_names() ],
43             country_code => [ Locale::Country::all_country_codes() ],
44             );
45              
46             1;
47              
48             __END__