Faker/Plugin/ColorName.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/EsEs/TelephoneNumber.pm ↑ Summary Faker/Plugin/ColorSafeName.pm »
1 package Faker::Plugin::ColorName;
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';
11  
12 # VERSION
13  
14 3 our $VERSION = '1.19';
15  
16 # METHODS
17  
18 7 ▶sub execute {
Subroutine execute: called CC=1 SCAR=0.0
Pod documented
19 7 my ($self, $data) = @_;
20  
21 7 return $self->faker->random->select(data_for_color_name());
22 }
23  
24 7 ▶sub data_for_color_name {
Subroutine data_for_color_name: called CC=1 SCAR=0.0
Pod undocumented
25 7 state $color_name = [
26 'AliceBlue',
27 'AntiqueWhite',
28 'Aqua',
29 'Aquamarine',
30 'Azure',
31 'Beige',
32 'Bisque',
33 'Black',
34 'BlanchedAlmond',
35 'Blue',
36 'BlueViolet',
37 'Brown',
38 'BurlyWood',
39 'CadetBlue',
40 'Chartreuse',
41 'Chocolate',
42 'Coral',
43 'CornflowerBlue',
44 'Cornsilk',
45 'Crimson',
46 'Cyan',
47 'DarkBlue',
48 'DarkCyan',
49 'DarkGoldenRod',
50 'DarkGray',
51 'DarkGreen',
52 'DarkKhaki',
53 'DarkMagenta',
54 'DarkOliveGreen',
55 'Darkorange',
56 'DarkOrchid',
57 'DarkRed',
58 'DarkSalmon',
59 'DarkSeaGreen',
60 'DarkSlateBlue',
61 'DarkSlateGray',
62 'DarkTurquoise',
63 'DarkViolet',
64 'DeepPink',
65 'DeepSkyBlue',
66 'DimGray',
67 'DimGrey',
68 'DodgerBlue',
69 'FireBrick',
70 'FloralWhite',
71 'ForestGreen',
72 'Fuchsia',
73 'Gainsboro',
74 'GhostWhite',
75 'Gold',
76 'GoldenRod',
77 'Gray',
78 'Green',
79 'GreenYellow',
80 'HoneyDew',
81 'HotPink',
82 'IndianRed',
83 'Indigo',
84 'Ivory',
85 'Khaki',
86 'Lavender',
87 'LavenderBlush',
88 'LawnGreen',
89 'LemonChiffon',
90 'LightBlue',
91 'LightCoral',
92 'LightCyan',
93 'LightGoldenRodYellow',
94 'LightGray',
95 'LightGreen',
96 'LightPink',
97 'LightSalmon',
98 'LightSeaGreen',
99 'LightSkyBlue',
100 'LightSlateGray',
101 'LightSteelBlue',
102 'LightYellow',
103 'Lime',
104 'LimeGreen',
105 'Linen',
106 'Magenta',
107 'Maroon',
108 'MediumAquaMarine',
109 'MediumBlue',
110 'MediumOrchid',
111 'MediumPurple',
112 'MediumSeaGreen',
113 'MediumSlateBlue',
114 'MediumSpringGreen',
115 'MediumTurquoise',
116 'MediumVioletRed',
117 'MidnightBlue',
118 'MintCream',
119 'MistyRose',
120 'Moccasin',
121 'NavajoWhite',
122 'Navy',
123 'OldLace',
124 'Olive',
125 'OliveDrab',
126 'Orange',
127 'OrangeRed',
128 'Orchid',
129 'PaleGoldenRod',
130 'PaleGreen',
131 'PaleTurquoise',
132 'PaleVioletRed',
133 'PapayaWhip',
134 'PeachPuff',
135 'Peru',
136 'Pink',
137 'Plum',
138 'PowderBlue',
139 'Purple',
140 'Red',
141 'RosyBrown',
142 'RoyalBlue',
143 'SaddleBrown',
144 'Salmon',
145 'SandyBrown',
146 'SeaGreen',
147 'SeaShell',
148 'Sienna',
149 'Silver',
150 'SkyBlue',
151 'SlateBlue',
152 'SlateGray',
153 'Snow',
154 'SpringGreen',
155 'SteelBlue',
156 'Tan',
157 'Teal',
158 'Thistle',
159 'Tomato',
160 'Turquoise',
161 'Violet',
162 'Wheat',
163 'White',
164 'WhiteSmoke',
165 'Yellow',
166 'YellowGreen',
167 ]
168 }
169  
170 3 1;
171  
172  
173  
174 =head1 NAME
175  
176 Faker::Plugin::ColorName - Color Name
177  
178 =cut
179  
180 =head1 ABSTRACT
181  
182 Color Name for Faker
183  
184 =cut
185  
186 =head1 VERSION
187  
188 1.19
189  
190 =cut
191  
192 =head1 SYNOPSIS
193  
194 package main;
195  
196 use Faker::Plugin::ColorName;
197  
198 my $plugin = Faker::Plugin::ColorName->new;
199  
200 # bless(..., "Faker::Plugin::ColorName")
201  
202 =cut
203  
204 =head1 DESCRIPTION
205  
206 This package provides methods for generating fake data for color name.
207  
208 =encoding utf8
209  
210 =cut
211  
212 =head1 INHERITS
213  
214 This package inherits behaviors from:
215  
216 L<Faker::Plugin>
217  
218 =cut
219  
220 =head1 METHODS
221  
222 This package provides the following methods:
223  
224 =cut
225  
226 =head2 execute
227  
228 execute(HashRef $data) (Str)
229  
230 The execute method returns a returns a random fake color name.
231  
232 I<Since C<1.10>>
233  
234 =over 4
235  
236 =item execute example 1
237  
238 package main;
239  
240 use Faker::Plugin::ColorName;
241  
242 my $plugin = Faker::Plugin::ColorName->new;
243  
244 # bless(..., "Faker::Plugin::ColorName")
245  
246 # my $result = $plugin->execute;
247  
248 # "GhostWhite";
249  
250 # my $result = $plugin->execute;
251  
252 # "Khaki";
253  
254 # my $result = $plugin->execute;
255  
256 # "SeaGreen";
257  
258 =back
259  
260 =cut
261  
262 =head2 new
263  
264 new(HashRef $data) (Plugin)
265  
266 The new method returns a new instance of the class.
267  
268 I<Since C<1.10>>
269  
270 =over 4
271  
272 =item new example 1
273  
274 package main;
275  
276 use Faker::Plugin::ColorName;
277  
278 my $plugin = Faker::Plugin::ColorName->new;
279  
280 # bless(..., "Faker::Plugin::ColorName")
281  
282 =back
283  
284 =cut
285  
286 =head1 AUTHORS
287  
288 Awncorp, C<awncorp@cpan.org>
289  
290 =cut
291  
292 =head1 LICENSE
293  
294 Copyright (C) 2000, Al Newkirk.
295  
296 This program is free software, you can redistribute it and/or modify it under
297 the terms of the Apache license version 2.0.
298  
299 =cut
« Faker/Plugin/EsEs/TelephoneNumber.pm ↑ Summary Faker/Plugin/ColorSafeName.pm »