Faker/Plugin/JaJp/PersonFirstName.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/JaJp/PersonFirstKanaName.pm ↑ Summary Faker/Plugin/EsEs/TelephoneNumber.pm »
1 package Faker::Plugin::JaJp::PersonFirstName;
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::JaJp';
11  
12 # VERSION
13  
14 2 our $VERSION = '1.19';
15  
16 # METHODS
17  
18 6 ▶sub execute {
Subroutine execute: called CC=2 SCAR=6.9
Pod documented
19 6 my ($self, $data) = @_;
20  
21 6 ▶ return (lc($self->faker->person_gender) eq 'male')
Branch: 1 branch
BranchTrueFalseTotal
lc $self->faker->person_gender eq 'male' ? : 4 2 6
22 ? $self->faker->random->select(data_for_first_name_male())
23 : $self->faker->random->select(data_for_first_name_female());
24 }
25  
26 4 ▶sub data_for_first_name_male {
Subroutine data_for_first_name_male: called CC=1 SCAR=0.0
Pod undocumented
27 4 state $first_name = [
28 '晃',
29 '篤司',
30 '治',
31 '和也',
32 '京助',
33 '健一',
34 '修平',
35 '翔太',
36 '淳',
37 '聡太郎',
38 '太一',
39 '太郎',
40 '拓真',
41 '翼',
42 '智也',
43 '直樹',
44 '直人',
45 '英樹',
46 '浩',
47 '学',
48 '充',
49 '稔',
50 '裕樹',
51 '裕太',
52 '康弘',
53 '陽一',
54 '洋介',
55 '亮介',
56 '涼平',
57 '零',
58 ]
59 }
60  
61 2 ▶sub data_for_first_name_female {
Subroutine data_for_first_name_female: called CC=1 SCAR=0.0
Pod undocumented
62 2 state $first_name = [
63 '明美',
64 'あすか',
65 '香織',
66 '加奈',
67 'くみ子',
68 'さゆり',
69 '知実',
70 '千代',
71 '直子',
72 '七夏',
73 '花子',
74 '春香',
75 '真綾',
76 '舞',
77 '美加子',
78 '幹',
79 '桃子',
80 '結衣',
81 '裕美子',
82 '陽子',
83 '里佳',
84 ]
85 }
86  
87 2 1;
88  
89  
90  
91 =head1 NAME
92  
93 Faker::Plugin::JaJp::PersonFirstName - Person First Name
94  
95 =cut
96  
97 =head1 ABSTRACT
98  
99 Person First Name for Faker
100  
101 =cut
102  
103 =head1 VERSION
104  
105 1.19
106  
107 =cut
108  
109 =head1 SYNOPSIS
110  
111 package main;
112  
113 use Faker::Plugin::JaJp::PersonFirstName;
114  
115 my $plugin = Faker::Plugin::JaJp::PersonFirstName->new;
116  
117 # bless(..., "Faker::Plugin::JaJp::PersonFirstName")
118  
119 =cut
120  
121 =head1 DESCRIPTION
122  
123 This package provides methods for generating fake data for person first name.
124  
125 =encoding utf8
126  
127 =cut
128  
129 =head1 INHERITS
130  
131 This package inherits behaviors from:
132  
133 L<Faker::Plugin::JaJp>
134  
135 =cut
136  
137 =head1 METHODS
138  
139 This package provides the following methods:
140  
141 =cut
142  
143 =head2 execute
144  
145 execute(HashRef $data) (Str)
146  
147 The execute method returns a returns a random fake person first name.
148  
149 I<Since C<1.10>>
150  
151 =over 4
152  
153 =item execute example 1
154  
155 package main;
156  
157 use Faker::Plugin::JaJp::PersonFirstName;
158  
159 my $plugin = Faker::Plugin::JaJp::PersonFirstName->new;
160  
161 # bless(..., "Faker::Plugin::JaJp::PersonFirstName")
162  
163 # my $result = $plugin->execute;
164  
165 # '拓真';
166  
167 # my $result = $plugin->execute;
168  
169 # '智也';
170  
171 # my $result = $plugin->execute;
172  
173 # '英樹';
174  
175 =back
176  
177 =cut
178  
179 =head2 new
180  
181 new(HashRef $data) (Plugin)
182  
183 The new method returns a new instance of the class.
184  
185 I<Since C<1.10>>
186  
187 =over 4
188  
189 =item new example 1
190  
191 package main;
192  
193 use Faker::Plugin::JaJp::PersonFirstName;
194  
195 my $plugin = Faker::Plugin::JaJp::PersonFirstName->new;
196  
197 # bless(..., "Faker::Plugin::JaJp::PersonFirstName")
198  
199 =back
200  
201 =cut
202  
203 =head1 AUTHORS
204  
205 Awncorp, C<awncorp@cpan.org>
206  
207 =cut
208  
209 =head1 LICENSE
210  
211 Copyright (C) 2000, Al Newkirk.
212  
213 This program is free software, you can redistribute it and/or modify it under
214 the terms of the Apache license version 2.0.
215  
216 =cut
« Faker/Plugin/JaJp/PersonFirstKanaName.pm ↑ Summary Faker/Plugin/EsEs/TelephoneNumber.pm »