Faker/Plugin/EsEs.pm

filter: Statementstmt 100% 21 / 21 Branchbran 50.0% 1 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 5 / 5 Podpod 100% 1 / 1 totaltotal 96.5% 28 / 29 CC 2 SCAR 2.9
CC
2
Cov
96%
new
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.3
« Faker/Plugin.pm ↑ Summary Faker/Plugin/JaJp.pm »
1 package Faker::Plugin::EsEs;
2  
3 38 ▶use 5.018;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 38 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 38 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 38 ▶use Venus::Class 'base';
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 38 base 'Faker::Plugin';
11  
12 # VERSION
13  
14 38 our $VERSION = '1.19';
15  
16 # MODIFIERS
17  
18 309 ▶sub new {
Subroutine new: called CC=2 SCAR=7.0
Pod documented
19 309 my ($self, @args) = @_;
20  
21 309 $self = $self->SUPER::new(@args);
22  
23 309 require Faker;
24  
25 309 my $caches = $self->faker->caches;
26  
27 309 $self->faker(Faker->new('es-es'));
28  
29 309 ▶ $self->faker->caches($caches) if $caches->count;
Branch: 1 branch
BranchTrueFalseTotal
if $caches->count 0 309 309
30  
31 309 return $self;
32 }
33  
34 38 1;
35  
36  
37  
38 =head1 NAME
39  
40 Faker::Plugin::EsEs - Es-Es Plugin Superclass
41  
42 =cut
43  
44 =head1 ABSTRACT
45  
46 Fake Data Plugin Superclass (Es-Es)
47  
48 =cut
49  
50 =head1 VERSION
51  
52 1.19
53  
54 =cut
55  
56 =head1 SYNOPSIS
57  
58 package main;
59  
60 use Faker::Plugin::EsEs;
61  
62 my $plugin = Faker::Plugin::EsEs->new;
63  
64 # bless(..., "Faker::Plugin::EsEs")
65  
66 # my $result = $plugin->execute;
67  
68 # ""
69  
70 =cut
71  
72 =head1 DESCRIPTION
73  
74 This package provides a superclass for es-es based plugins.
75  
76 =encoding utf8
77  
78 =cut
79  
80 =head1 INHERITS
81  
82 This package inherits behaviors from:
83  
84 L<Faker::Plugin>
85  
86 =cut
87  
88 =head1 METHODS
89  
90 This package provides the following methods:
91  
92 =cut
93  
94 =head2 new
95  
96 new(HashRef $data) (Plugin)
97  
98 The new method returns a new instance of the class.
99  
100 I<Since C<1.10>>
101  
102 =over 4
103  
104 =item new example 1
105  
106 package main;
107  
108 use Faker::Plugin::EsEs;
109  
110 my $plugin = Faker::Plugin::EsEs->new;
111  
112 # bless(..., "Faker::Plugin::EsEs")
113  
114 =back
115  
116 =over 4
117  
118 =item new example 2
119  
120 package main;
121  
122 use Faker::Plugin::EsEs;
123  
124 my $plugin = Faker::Plugin::EsEs->new({faker => 'ru-ru'});
125  
126 # bless(..., "Faker::Plugin::EsEs")
127  
128 =back
129  
130 =over 4
131  
132 =item new example 3
133  
134 package main;
135  
136 use Faker::Plugin::EsEs;
137  
138 my $plugin = Faker::Plugin::EsEs->new({faker => ['ru-ru', 'sk-sk']});
139  
140 # bless(..., "Faker::Plugin::EsEs")
141  
142 =back
143  
144 =cut
145  
146 =head1 FEATURES
147  
148 This package provides the following features:
149  
150 =cut
151  
152 =over 4
153  
154 =item subclass-feature
155  
156 This package is meant to be subclassed.
157  
158 B<example 1>
159  
160 package Faker::Plugin::EsEs::UserHandle;
161  
162 use base 'Faker::Plugin::EsEs';
163  
164 sub execute {
165 my ($self) = @_;
166  
167 return $self->process('@?{{person_last_name}}####');
168 }
169  
170 package main;
171  
172 use Faker;
173  
174 my $faker = Faker->new('es-es');
175  
176 # bless(..., "Faker")
177  
178 my $result = $faker->user_handle;
179  
180 # "\@CJaimes9397"
181  
182 =back
183  
184 =head1 AUTHORS
185  
186 Awncorp, C<awncorp@cpan.org>
187  
188 =cut
189  
190 =head1 LICENSE
191  
192 Copyright (C) 2000, Al Newkirk.
193  
194 This program is free software, you can redistribute it and/or modify it under
195 the terms of the Apache license version 2.0.
196  
197 =cut
« Faker/Plugin.pm ↑ Summary Faker/Plugin/JaJp.pm »