Faker/Plugin/EnUs/PersonNamePrefix.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/PersonFirstName.pm ↑ Summary Faker/Plugin/EnUs/PersonNameSuffix.pm »
1 package Faker::Plugin::EnUs::PersonNamePrefix;
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_prefix_male())
23 : $self->faker->random->select(data_for_name_prefix_female());
24 }
25  
26 6 ▶sub data_for_name_prefix_male {
Subroutine data_for_name_prefix_male: called CC=1 SCAR=0.0
Pod undocumented
27 6 state $name_prefix = [
28 'Mr.',
29 'Sir',
30 ]
31 }
32  
33 2 ▶sub data_for_name_prefix_female {
Subroutine data_for_name_prefix_female: called CC=1 SCAR=0.0
Pod undocumented
34 2 state $name_prefix = [
35 'Miss',
36 'Mrs.',
37 'Ms.',
38 ]
39 }
40  
41 3 1;
42  
43  
44  
45 =head1 NAME
46  
47 Faker::Plugin::EnUs::PersonNamePrefix - Person Name Prefix
48  
49 =cut
50  
51 =head1 ABSTRACT
52  
53 Person Name Prefix for Faker
54  
55 =cut
56  
57 =head1 VERSION
58  
59 1.19
60  
61 =cut
62  
63 =head1 SYNOPSIS
64  
65 package main;
66  
67 use Faker::Plugin::EnUs::PersonNamePrefix;
68  
69 my $plugin = Faker::Plugin::EnUs::PersonNamePrefix->new;
70  
71 # bless(..., "Faker::Plugin::EnUs::PersonNamePrefix")
72  
73 =cut
74  
75 =head1 DESCRIPTION
76  
77 This package provides methods for generating fake data for person name prefix.
78  
79 =encoding utf8
80  
81 =cut
82  
83 =head1 INHERITS
84  
85 This package inherits behaviors from:
86  
87 L<Faker::Plugin::EnUs>
88  
89 =cut
90  
91 =head1 METHODS
92  
93 This package provides the following methods:
94  
95 =cut
96  
97 =head2 execute
98  
99 execute(HashRef $data) (Str)
100  
101 The execute method returns a returns a random fake person name prefix.
102  
103 I<Since C<1.10>>
104  
105 =over 4
106  
107 =item execute example 1
108  
109 package main;
110  
111 use Faker::Plugin::EnUs::PersonNamePrefix;
112  
113 my $plugin = Faker::Plugin::EnUs::PersonNamePrefix->new;
114  
115 # bless(..., "Faker::Plugin::EnUs::PersonNamePrefix")
116  
117 # my $result = $plugin->execute;
118  
119 # "Mr.";
120  
121 # my $result = $plugin->execute;
122  
123 # "Mr.";
124  
125 # my $result = $plugin->execute;
126  
127 # "Sir";
128  
129 =back
130  
131 =cut
132  
133 =head2 new
134  
135 new(HashRef $data) (Plugin)
136  
137 The new method returns a new instance of the class.
138  
139 I<Since C<1.10>>
140  
141 =over 4
142  
143 =item new example 1
144  
145 package main;
146  
147 use Faker::Plugin::EnUs::PersonNamePrefix;
148  
149 my $plugin = Faker::Plugin::EnUs::PersonNamePrefix->new;
150  
151 # bless(..., "Faker::Plugin::EnUs::PersonNamePrefix")
152  
153 =back
154  
155 =cut
156  
157 =head1 AUTHORS
158  
159 Awncorp, C<awncorp@cpan.org>
160  
161 =cut
162  
163 =head1 LICENSE
164  
165 Copyright (C) 2000, Al Newkirk.
166  
167 This program is free software, you can redistribute it and/or modify it under
168 the terms of the Apache license version 2.0.
169  
170 =cut
« Faker/Plugin/EnUs/PersonFirstName.pm ↑ Summary Faker/Plugin/EnUs/PersonNameSuffix.pm »