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