line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Faker::Plugin::PaymentCardNumber; |
2
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
21865
|
use 5.018; |
|
2
|
|
|
|
|
8
|
|
4
|
|
|
|
|
|
|
|
5
|
2
|
|
|
2
|
|
12
|
use strict; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
52
|
|
6
|
2
|
|
|
2
|
|
10
|
use warnings; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
71
|
|
7
|
|
|
|
|
|
|
|
8
|
2
|
|
|
2
|
|
15
|
use Venus::Class 'base'; |
|
2
|
|
|
|
|
10
|
|
|
2
|
|
|
|
|
21
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
base 'Faker::Plugin'; |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
# VERSION |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
our $VERSION = '1.17'; |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
# METHODS |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
sub execute { |
19
|
6
|
|
|
6
|
1
|
2761
|
my ($self, $data) = @_; |
20
|
|
|
|
|
|
|
|
21
|
6
|
|
33
|
|
|
44
|
my $method = $data->{method} ||= $self->faker->random->select( |
22
|
|
|
|
|
|
|
data_for_payment_card_number() |
23
|
|
|
|
|
|
|
); |
24
|
|
|
|
|
|
|
|
25
|
6
|
|
|
|
|
201
|
return $self->faker->$method; |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
sub data_for_payment_card_number { |
29
|
6
|
|
|
6
|
0
|
46
|
state $payment_card_number = [ |
30
|
|
|
|
|
|
|
map('payment_card_visa', 1..6), |
31
|
|
|
|
|
|
|
map('payment_card_mastercard', 1..3), |
32
|
|
|
|
|
|
|
map('payment_card_american_express', 1..2), |
33
|
|
|
|
|
|
|
'payment_card_discover', |
34
|
|
|
|
|
|
|
] |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
1; |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
=head1 NAME |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
Faker::Plugin::PaymentCardNumber - Payment Card Number |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
=cut |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
=head1 ABSTRACT |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
Payment Card Number for Faker |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
=cut |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
=head1 VERSION |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
1.17 |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
=cut |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
=head1 SYNOPSIS |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
package main; |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
use Faker::Plugin::PaymentCardNumber; |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
my $plugin = Faker::Plugin::PaymentCardNumber->new; |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
# bless(..., "Faker::Plugin::PaymentCardNumber") |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
=cut |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
=head1 DESCRIPTION |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
This package provides methods for generating fake data for payment card number. |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
=encoding utf8 |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
=cut |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
=head1 INHERITS |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
This package inherits behaviors from: |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
L |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
=cut |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
=head1 METHODS |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
This package provides the following methods: |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
=cut |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
=head2 execute |
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
execute(HashRef $data) (Str) |
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
The execute method returns a returns a random fake payment card number. |
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
I> |
100
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
=over 4 |
102
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
=item execute example 1 |
104
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
package main; |
106
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
use Faker::Plugin::PaymentCardNumber; |
108
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
my $plugin = Faker::Plugin::PaymentCardNumber->new; |
110
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
# bless(..., "Faker::Plugin::PaymentCardNumber") |
112
|
|
|
|
|
|
|
|
113
|
|
|
|
|
|
|
# my $result = $plugin->execute; |
114
|
|
|
|
|
|
|
|
115
|
|
|
|
|
|
|
# 453208446845507; |
116
|
|
|
|
|
|
|
|
117
|
|
|
|
|
|
|
# my $result = $plugin->execute; |
118
|
|
|
|
|
|
|
|
119
|
|
|
|
|
|
|
# 37443908982203; |
120
|
|
|
|
|
|
|
|
121
|
|
|
|
|
|
|
# my $result = $plugin->execute; |
122
|
|
|
|
|
|
|
|
123
|
|
|
|
|
|
|
# 491658288205589; |
124
|
|
|
|
|
|
|
|
125
|
|
|
|
|
|
|
=back |
126
|
|
|
|
|
|
|
|
127
|
|
|
|
|
|
|
=cut |
128
|
|
|
|
|
|
|
|
129
|
|
|
|
|
|
|
=head2 new |
130
|
|
|
|
|
|
|
|
131
|
|
|
|
|
|
|
new(HashRef $data) (Plugin) |
132
|
|
|
|
|
|
|
|
133
|
|
|
|
|
|
|
The new method returns a new instance of the class. |
134
|
|
|
|
|
|
|
|
135
|
|
|
|
|
|
|
I> |
136
|
|
|
|
|
|
|
|
137
|
|
|
|
|
|
|
=over 4 |
138
|
|
|
|
|
|
|
|
139
|
|
|
|
|
|
|
=item new example 1 |
140
|
|
|
|
|
|
|
|
141
|
|
|
|
|
|
|
package main; |
142
|
|
|
|
|
|
|
|
143
|
|
|
|
|
|
|
use Faker::Plugin::PaymentCardNumber; |
144
|
|
|
|
|
|
|
|
145
|
|
|
|
|
|
|
my $plugin = Faker::Plugin::PaymentCardNumber->new; |
146
|
|
|
|
|
|
|
|
147
|
|
|
|
|
|
|
# bless(..., "Faker::Plugin::PaymentCardNumber") |
148
|
|
|
|
|
|
|
|
149
|
|
|
|
|
|
|
=back |
150
|
|
|
|
|
|
|
|
151
|
|
|
|
|
|
|
=cut |