Faker/Plugin/EnUs/PersonFormalName.pm

filter: Statementstmt 100% 17 / 17 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 6 / 6 Podpod 50.0% 1 / 2 totaltotal 96.0% 24 / 25 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« Faker/Plugin/EnUs/JargonVerb.pm ↑ Summary Faker/Plugin/EnUs/PersonLastName.pm »
1 package Faker::Plugin::EnUs::PersonFormalName;
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::EnUs';
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 return $self->process_format($self->faker->random->select(format_for_name()));
22 }
23  
24 6 ▶sub format_for_name {
Subroutine format_for_name: called CC=1 SCAR=0.0
Pod undocumented
25 6 state $name = [
26 map([
27 '{{person_first_name}}',
28 '{{person_last_name}}'
29 ], 1..6),
30 [
31 '{{person_name_prefix}}',
32 '{{person_first_name}}',
33 '{{person_last_name}}'
34 ],
35 [
36 '{{person_first_name}}',
37 '{{person_last_name}}',
38 '{{person_name_suffix}}'
39 ],
40 [
41 '{{person_first_name}}',
42 '{{person_first_name}}',
43 '{{person_last_name}}',
44 '{{person_name_suffix}}'
45 ],
46 [
47 '{{person_name_prefix}}',
48 '{{person_first_name}}',
49 '{{person_first_name}}',
50 '{{person_last_name}}',
51 '{{person_name_suffix}}',
52 ],
53 [
54 '{{person_name_prefix}}',
55 '{{person_first_name}}',
56 '{{person_last_name}}',
57 '{{person_name_suffix}}',
58 ]
59 ]
60 }
61  
62 2 1;
63  
64  
65  
66 =head1 NAME
67  
68 Faker::Plugin::EnUs::PersonFormalName - Person Formal Name
69  
70 =cut
71  
72 =head1 ABSTRACT
73  
74 Person Formal Name for Faker
75  
76 =cut
77  
78 =head1 VERSION
79  
80 1.19
81  
82 =cut
83  
84 =head1 SYNOPSIS
85  
86 package main;
87  
88 use Faker::Plugin::EnUs::PersonFormalName;
89  
90 my $plugin = Faker::Plugin::EnUs::PersonFormalName->new;
91  
92 # bless(..., "Faker::Plugin::EnUs::PersonFormalName")
93  
94 =cut
95  
96 =head1 DESCRIPTION
97  
98 This package provides methods for generating fake data for person formal name.
99  
100 =encoding utf8
101  
102 =cut
103  
104 =head1 INHERITS
105  
106 This package inherits behaviors from:
107  
108 L<Faker::Plugin::EnUs>
109  
110 =cut
111  
112 =head1 METHODS
113  
114 This package provides the following methods:
115  
116 =cut
117  
118 =head2 execute
119  
120 execute(HashRef $data) (Str)
121  
122 The execute method returns a returns a random fake person formal name.
123  
124 I<Since C<1.10>>
125  
126 =over 4
127  
128 =item execute example 1
129  
130 package main;
131  
132 use Faker::Plugin::EnUs::PersonFormalName;
133  
134 my $plugin = Faker::Plugin::EnUs::PersonFormalName->new;
135  
136 # bless(..., "Faker::Plugin::EnUs::PersonFormalName")
137  
138 # my $result = $plugin->execute;
139  
140 # "Russel Krajcik";
141  
142 # my $result = $plugin->execute;
143  
144 # "Miss Josephine Forest Beier DDS";
145  
146 # my $result = $plugin->execute;
147  
148 # "Duncan Mann";
149  
150 =back
151  
152 =cut
153  
154 =head2 new
155  
156 new(HashRef $data) (Plugin)
157  
158 The new method returns a new instance of the class.
159  
160 I<Since C<1.10>>
161  
162 =over 4
163  
164 =item new example 1
165  
166 package main;
167  
168 use Faker::Plugin::EnUs::PersonFormalName;
169  
170 my $plugin = Faker::Plugin::EnUs::PersonFormalName->new;
171  
172 # bless(..., "Faker::Plugin::EnUs::PersonFormalName")
173  
174 =back
175  
176 =cut
177  
178 =head1 AUTHORS
179  
180 Awncorp, C<awncorp@cpan.org>
181  
182 =cut
183  
184 =head1 LICENSE
185  
186 Copyright (C) 2000, Al Newkirk.
187  
188 This program is free software, you can redistribute it and/or modify it under
189 the terms of the Apache license version 2.0.
190  
191 =cut
« Faker/Plugin/EnUs/JargonVerb.pm ↑ Summary Faker/Plugin/EnUs/PersonLastName.pm »