Faker/Plugin/EnUs/PersonNameSuffix.pm

filter: Statementstmt 100% 18 / 18 Branchbran 100% 2 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 7 / 7 Podpod 33.3% 1 / 3 totaltotal 93.3% 28 / 30 CC 2 SCAR 2.2
CC
2
Cov
100%
execute
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.2
« Faker/Plugin/EnUs/PersonNamePrefix.pm ↑ Summary Faker/Plugin/EsEs/PersonFirstName.pm »
1 package Faker::Plugin::EnUs::PersonNameSuffix;
2  
3 3 ▶use 5.018;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 3 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 3 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 3 ▶use Venus::Class 'base';
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 3 base 'Faker::Plugin::EnUs';
11  
12 # VERSION
13  
14 3 our $VERSION = '1.19';
15  
16 # METHODS
17  
18 8 ▶sub execute {
Subroutine execute: called CC=2 SCAR=6.9
Pod documented
19 8 my ($self, $data) = @_;
20  
21 8 ▶ return lc($self->faker->person_gender) eq 'male'
Branch: 1 branch
BranchTrueFalseTotal
lc $self->faker->person_gender eq 'male' ? : 6 2 8
22 ? $self->faker->random->select(data_for_name_suffix_male())
23 : $self->faker->random->select(data_for_name_suffix());
24 }
25  
26 4 ▶sub data_for_name_suffix {
Subroutine data_for_name_suffix: called CC=1 SCAR=0.0
Pod undocumented
27 4 state $name_suffix = [
28 'MD',
29 'DDS',
30 'PhD',
31 'DVM',
32 ]
33 }
34  
35 6 ▶sub data_for_name_suffix_male {
Subroutine data_for_name_suffix_male: called CC=1 SCAR=0.0
Pod undocumented
36 6 state $name_suffix = [
37 data_for_name_suffix(),
38 'Jr.',
39 'Sr.',
40 'I',
41 'II',
42 'III',
43 'IV',
44 'V',
45 ]
46 }
47  
48 3 1;
49  
50  
51  
52 =head1 NAME
53  
54 Faker::Plugin::EnUs::PersonNameSuffix - Person Name Suffix
55  
56 =cut
57  
58 =head1 ABSTRACT
59  
60 Person Name Suffix for Faker
61  
62 =cut
63  
64 =head1 VERSION
65  
66 1.19
67  
68 =cut
69  
70 =head1 SYNOPSIS
71  
72 package main;
73  
74 use Faker::Plugin::EnUs::PersonNameSuffix;
75  
76 my $plugin = Faker::Plugin::EnUs::PersonNameSuffix->new;
77  
78 # bless(..., "Faker::Plugin::EnUs::PersonNameSuffix")
79  
80 =cut
81  
82 =head1 DESCRIPTION
83  
84 This package provides methods for generating fake data for person name suffix.
85  
86 =encoding utf8
87  
88 =cut
89  
90 =head1 INHERITS
91  
92 This package inherits behaviors from:
93  
94 L<Faker::Plugin::EnUs>
95  
96 =cut
97  
98 =head1 METHODS
99  
100 This package provides the following methods:
101  
102 =cut
103  
104 =head2 execute
105  
106 execute(HashRef $data) (Str)
107  
108 The execute method returns a returns a random fake person name suffix.
109  
110 I<Since C<1.10>>
111  
112 =over 4
113  
114 =item execute example 1
115  
116 package main;
117  
118 use Faker::Plugin::EnUs::PersonNameSuffix;
119  
120 my $plugin = Faker::Plugin::EnUs::PersonNameSuffix->new;
121  
122 # bless(..., "Faker::Plugin::EnUs::PersonNameSuffix")
123  
124 # my $result = $plugin->execute;
125  
126 # "I";
127  
128 # my $result = $plugin->execute;
129  
130 # "I";
131  
132 # my $result = $plugin->execute;
133  
134 # "II";
135  
136 =back
137  
138 =cut
139  
140 =head2 new
141  
142 new(HashRef $data) (Plugin)
143  
144 The new method returns a new instance of the class.
145  
146 I<Since C<1.10>>
147  
148 =over 4
149  
150 =item new example 1
151  
152 package main;
153  
154 use Faker::Plugin::EnUs::PersonNameSuffix;
155  
156 my $plugin = Faker::Plugin::EnUs::PersonNameSuffix->new;
157  
158 # bless(..., "Faker::Plugin::EnUs::PersonNameSuffix")
159  
160 =back
161  
162 =cut
163  
164 =head1 AUTHORS
165  
166 Awncorp, C<awncorp@cpan.org>
167  
168 =cut
169  
170 =head1 LICENSE
171  
172 Copyright (C) 2000, Al Newkirk.
173  
174 This program is free software, you can redistribute it and/or modify it under
175 the terms of the Apache license version 2.0.
176  
177 =cut
« Faker/Plugin/EnUs/PersonNamePrefix.pm ↑ Summary Faker/Plugin/EsEs/PersonFirstName.pm »