Faker/Plugin/PaymentCardExpiration.pm

filter: Statementstmt 100% 19 / 19 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 5 / 5 Podpod 100% 1 / 1 totaltotal 100% 25 / 25 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« Faker/Plugin/JaJp/CompanyTagline.pm ↑ Summary Faker/Plugin/PersonGender.pm »
1 package Faker::Plugin::PaymentCardExpiration;
2  
3 2 ▶use 5.018;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 2 ▶use Venus::Class 'base';
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 2 base 'Faker::Plugin';
11  
12 # VERSION
13  
14 2 our $VERSION = '1.19';
15  
16 # METHODS
17  
18 6 ▶sub execute {
Subroutine execute: called CC=1 SCAR=0.0
Pod documented
19 6 my ($self, $data) = @_;
20  
21 6 my $pad = $self->faker->random->range(1,3);
22 6 my $month = sprintf('%02d', $self->faker->random->range(1,12));
23 6 my $year = sprintf('%02d', ((localtime)[5] % 100) + $pad);
24  
25 6 return "$month/$year";
26 }
27  
28 2 1;
29  
30  
31  
32 =head1 NAME
33  
34 Faker::Plugin::PaymentCardExpiration - Payment Card Expiration
35  
36 =cut
37  
38 =head1 ABSTRACT
39  
40 Payment Card Expiration for Faker
41  
42 =cut
43  
44 =head1 VERSION
45  
46 1.19
47  
48 =cut
49  
50 =head1 SYNOPSIS
51  
52 package main;
53  
54 use Faker::Plugin::PaymentCardExpiration;
55  
56 my $plugin = Faker::Plugin::PaymentCardExpiration->new;
57  
58 # bless(..., "Faker::Plugin::PaymentCardExpiration")
59  
60 =cut
61  
62 =head1 DESCRIPTION
63  
64 This package provides methods for generating fake data for payment card expiration.
65  
66 =encoding utf8
67  
68 =cut
69  
70 =head1 INHERITS
71  
72 This package inherits behaviors from:
73  
74 L<Faker::Plugin>
75  
76 =cut
77  
78 =head1 METHODS
79  
80 This package provides the following methods:
81  
82 =cut
83  
84 =head2 execute
85  
86 execute(HashRef $data) (Str)
87  
88 The execute method returns a returns a random fake payment card expiration.
89  
90 I<Since C<1.10>>
91  
92 =over 4
93  
94 =item execute example 1
95  
96 package main;
97  
98 use Faker::Plugin::PaymentCardExpiration;
99  
100 my $plugin = Faker::Plugin::PaymentCardExpiration->new;
101  
102 # bless(..., "Faker::Plugin::PaymentCardExpiration")
103  
104 # my $result = $plugin->execute;
105  
106 # "02/24";
107  
108 # my $result = $plugin->execute;
109  
110 # "11/23";
111  
112 # my $result = $plugin->execute;
113  
114 # "09/24";
115  
116 =back
117  
118 =cut
119  
120 =head2 new
121  
122 new(HashRef $data) (Plugin)
123  
124 The new method returns a new instance of the class.
125  
126 I<Since C<1.10>>
127  
128 =over 4
129  
130 =item new example 1
131  
132 package main;
133  
134 use Faker::Plugin::PaymentCardExpiration;
135  
136 my $plugin = Faker::Plugin::PaymentCardExpiration->new;
137  
138 # bless(..., "Faker::Plugin::PaymentCardExpiration")
139  
140 =back
141  
142 =cut
143  
144 =head1 AUTHORS
145  
146 Awncorp, C<awncorp@cpan.org>
147  
148 =cut
149  
150 =head1 LICENSE
151  
152 Copyright (C) 2000, Al Newkirk.
153  
154 This program is free software, you can redistribute it and/or modify it under
155 the terms of the Apache license version 2.0.
156  
157 =cut
« Faker/Plugin/JaJp/CompanyTagline.pm ↑ Summary Faker/Plugin/PersonGender.pm »