File Coverage

blib/lib/Faker/Plugin/SoftwareAuthor.pm
Criterion Covered Total %
statement 14 14 100.0
branch n/a
condition n/a
subroutine 6 6 100.0
pod 1 2 50.0
total 21 22 95.4


line stmt bran cond sub pod time code
1             package Faker::Plugin::SoftwareAuthor;
2              
3 2     2   39396 use 5.018;
  2         8  
4              
5 2     2   15 use strict;
  2         3  
  2         50  
6 2     2   13 use warnings;
  2         6  
  2         60  
7              
8 2     2   15 use Venus::Class 'base';
  2         5  
  2         14  
9              
10             base 'Faker::Plugin';
11              
12             # VERSION
13              
14             our $VERSION = '1.19';
15              
16             # METHODS
17              
18             sub execute {
19 6     6 1 2625 my ($self, $data) = @_;
20              
21 6         30 return $self->process_format(
22             $self->faker->random->select(format_for_software_author())
23             );
24             }
25              
26             sub format_for_software_author {
27 6     6 0 35 state $software_author = [
28             map([
29             '{{person_name}}'
30             ], 1..3),
31             [
32             '{{company_name}}',
33             ],
34             ]
35             }
36              
37             1;
38              
39              
40              
41             =head1 NAME
42              
43             Faker::Plugin::SoftwareAuthor - Software Author
44              
45             =cut
46              
47             =head1 ABSTRACT
48              
49             Software Author for Faker
50              
51             =cut
52              
53             =head1 VERSION
54              
55             1.19
56              
57             =cut
58              
59             =head1 SYNOPSIS
60              
61             package main;
62              
63             use Faker::Plugin::SoftwareAuthor;
64              
65             my $plugin = Faker::Plugin::SoftwareAuthor->new;
66              
67             # bless(..., "Faker::Plugin::SoftwareAuthor")
68              
69             =cut
70              
71             =head1 DESCRIPTION
72              
73             This package provides methods for generating fake data for software author.
74              
75             =encoding utf8
76              
77             =cut
78              
79             =head1 INHERITS
80              
81             This package inherits behaviors from:
82              
83             L
84              
85             =cut
86              
87             =head1 METHODS
88              
89             This package provides the following methods:
90              
91             =cut
92              
93             =head2 execute
94              
95             execute(HashRef $data) (Str)
96              
97             The execute method returns a returns a random fake software author.
98              
99             I>
100              
101             =over 4
102              
103             =item execute example 1
104              
105             package main;
106              
107             use Faker::Plugin::SoftwareAuthor;
108              
109             my $plugin = Faker::Plugin::SoftwareAuthor->new(
110             faker => {locales => ['en-us']},
111             );
112              
113             # bless(..., "Faker::Plugin::SoftwareAuthor")
114              
115             # my $result = $plugin->execute;
116              
117             # "Jamison Skiles";
118              
119             # my $result = $plugin->execute;
120              
121             # "Josephine Kunde";
122              
123             # my $result = $plugin->execute;
124              
125             # "Darby Boyer";
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>
138              
139             =over 4
140              
141             =item new example 1
142              
143             package main;
144              
145             use Faker::Plugin::SoftwareAuthor;
146              
147             my $plugin = Faker::Plugin::SoftwareAuthor->new;
148              
149             # bless(..., "Faker::Plugin::SoftwareAuthor")
150              
151             =back
152              
153             =cut
154              
155             =head1 AUTHORS
156              
157             Awncorp, C
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