Faker/Plugin/ColorRgbColorset.pm

filter: Statementstmt 100% 18 / 18 Branchbran 100% 2 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 5 / 5 Podpod 100% 1 / 1 totaltotal 100% 26 / 26 CC 2 SCAR 2.9
CC
2
Cov
100%
execute
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.3
« Faker/Plugin/JaJp.pm ↑ Summary Faker/Plugin/EnUs.pm »
1 package Faker::Plugin::ColorRgbColorset;
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 12 ▶sub execute {
Subroutine execute: called CC=2 SCAR=6.9
Pod documented
19 12 my ($self, $data) = @_;
20  
21 12 my $color = $self->faker->color_hex_code;
22  
23 12 my $colorset = [
24 hex(substr($color, 1, 2)),
25 hex(substr($color, 3, 2)),
26 hex(substr($color, 5, 2)),
27 ];
28  
29 12 ▶ return wantarray ? (@$colorset) : $colorset;
Branch: 1 branch
BranchTrueFalseTotal
wantarray ? : 6 6 12
30 }
31  
32 3 1;
33  
34  
35  
36 =head1 NAME
37  
38 Faker::Plugin::ColorRgbColorset - Color Rgb Colorset
39  
40 =cut
41  
42 =head1 ABSTRACT
43  
44 Color Rgb Colorset for Faker
45  
46 =cut
47  
48 =head1 VERSION
49  
50 1.19
51  
52 =cut
53  
54 =head1 SYNOPSIS
55  
56 package main;
57  
58 use Faker::Plugin::ColorRgbColorset;
59  
60 my $plugin = Faker::Plugin::ColorRgbColorset->new;
61  
62 # bless(..., "Faker::Plugin::ColorRgbColorset")
63  
64 =cut
65  
66 =head1 DESCRIPTION
67  
68 This package provides methods for generating fake data for color rgb colorset.
69  
70 =encoding utf8
71  
72 =cut
73  
74 =head1 INHERITS
75  
76 This package inherits behaviors from:
77  
78 L<Faker::Plugin>
79  
80 =cut
81  
82 =head1 METHODS
83  
84 This package provides the following methods:
85  
86 =cut
87  
88 =head2 execute
89  
90 execute(HashRef $data) (Str)
91  
92 The execute method returns a returns a random fake color rgb colorset.
93  
94 I<Since C<1.10>>
95  
96 =over 4
97  
98 =item execute example 1
99  
100 package main;
101  
102 use Faker::Plugin::ColorRgbColorset;
103  
104 my $plugin = Faker::Plugin::ColorRgbColorset->new;
105  
106 # bless(..., "Faker::Plugin::ColorRgbColorset")
107  
108 # my $result = $plugin->execute;
109  
110 # [28, 112, 22];
111  
112 # my $result = $plugin->execute;
113  
114 # [219, 63, 178];
115  
116 # my $result = $plugin->execute;
117  
118 # [176, 217, 21];
119  
120 =back
121  
122 =cut
123  
124 =head2 new
125  
126 new(HashRef $data) (Plugin)
127  
128 The new method returns a new instance of the class.
129  
130 I<Since C<1.10>>
131  
132 =over 4
133  
134 =item new example 1
135  
136 package main;
137  
138 use Faker::Plugin::ColorRgbColorset;
139  
140 my $plugin = Faker::Plugin::ColorRgbColorset->new;
141  
142 # bless(..., "Faker::Plugin::ColorRgbColorset")
143  
144 =back
145  
146 =cut
147  
148 =head1 AUTHORS
149  
150 Awncorp, C<awncorp@cpan.org>
151  
152 =cut
153  
154 =head1 LICENSE
155  
156 Copyright (C) 2000, Al Newkirk.
157  
158 This program is free software, you can redistribute it and/or modify it under
159 the terms of the Apache license version 2.0.
160  
161 =cut
« Faker/Plugin/JaJp.pm ↑ Summary Faker/Plugin/EnUs.pm »