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