File Coverage

blib/lib/Faker/Plugin/EnUs/AddressPostalCode.pm
Criterion Covered Total %
statement 14 14 100.0
branch n/a
condition n/a
subroutine 6 6 100.0
pod 1 2 50.0
total 21 22 95.4


line stmt bran cond sub pod time code
1             package Faker::Plugin::EnUs::AddressPostalCode;
2              
3 3     3   41148 use 5.018;
  3         12  
4              
5 3     3   20 use strict;
  3         6  
  3         63  
6 3     3   16 use warnings;
  3         6  
  3         84  
7              
8 3     3   21 use Venus::Class 'base';
  3         5  
  3         23  
9              
10             base 'Faker::Plugin::EnUs';
11              
12             # VERSION
13              
14             our $VERSION = '1.19';
15              
16             # METHODS
17              
18             sub execute {
19 12     12 1 1372 my ($self, $data) = @_;
20              
21 12         48 return $self->process_markers(
22             $self->faker->random->select(data_for_address_postal_code()),
23             'numbers',
24             );
25             }
26              
27             sub data_for_address_postal_code {
28 12     12 0 51 state $address_postal_code = [
29             '#####',
30             '#####-####',
31             ]
32             }
33              
34             1;
35              
36              
37              
38             =head1 NAME
39              
40             Faker::Plugin::EnUs::AddressPostalCode - Address Postal Code
41              
42             =cut
43              
44             =head1 ABSTRACT
45              
46             Address Postal Code for Faker
47              
48             =cut
49              
50             =head1 VERSION
51              
52             1.19
53              
54             =cut
55              
56             =head1 SYNOPSIS
57              
58             package main;
59              
60             use Faker::Plugin::EnUs::AddressPostalCode;
61              
62             my $plugin = Faker::Plugin::EnUs::AddressPostalCode->new;
63              
64             # bless(..., "Faker::Plugin::EnUs::AddressPostalCode")
65              
66             =cut
67              
68             =head1 DESCRIPTION
69              
70             This package provides methods for generating fake data for address postal code.
71              
72             =encoding utf8
73              
74             =cut
75              
76             =head1 INHERITS
77              
78             This package inherits behaviors from:
79              
80             L
81              
82             =cut
83              
84             =head1 METHODS
85              
86             This package provides the following methods:
87              
88             =cut
89              
90             =head2 execute
91              
92             execute(HashRef $data) (Str)
93              
94             The execute method returns a returns a random fake address postal code.
95              
96             I>
97              
98             =over 4
99              
100             =item execute example 1
101              
102             package main;
103              
104             use Faker::Plugin::EnUs::AddressPostalCode;
105              
106             my $plugin = Faker::Plugin::EnUs::AddressPostalCode->new;
107              
108             # bless(..., "Faker::Plugin::EnUs::AddressPostalCode")
109              
110             # my $result = $plugin->execute;
111              
112             # 14084;
113              
114             # my $result = $plugin->execute;
115              
116             # "84550-7694";
117              
118             # my $result = $plugin->execute;
119              
120             # 43908;
121              
122             =back
123              
124             =cut
125              
126             =head2 new
127              
128             new(HashRef $data) (Plugin)
129              
130             The new method returns a new instance of the class.
131              
132             I>
133              
134             =over 4
135              
136             =item new example 1
137              
138             package main;
139              
140             use Faker::Plugin::EnUs::AddressPostalCode;
141              
142             my $plugin = Faker::Plugin::EnUs::AddressPostalCode->new;
143              
144             # bless(..., "Faker::Plugin::EnUs::AddressPostalCode")
145              
146             =back
147              
148             =cut
149              
150             =head1 AUTHORS
151              
152             Awncorp, C
153              
154             =cut
155              
156             =head1 LICENSE
157              
158             Copyright (C) 2000, Al Newkirk.
159              
160             This program is free software, you can redistribute it and/or modify it under
161             the terms of the Apache license version 2.0.
162              
163             =cut