File Coverage

blib/lib/Faker/Plugin/EnUs/InternetDomainWord.pm
Criterion Covered Total %
statement 16 16 100.0
branch n/a
condition n/a
subroutine 5 5 100.0
pod 1 1 100.0
total 22 22 100.0


line stmt bran cond sub pod time code
1             package Faker::Plugin::EnUs::InternetDomainWord;
2              
3 5     5   24292 use 5.018;
  5         20  
4              
5 5     5   28 use strict;
  5         14  
  5         117  
6 5     5   25 use warnings;
  5         11  
  5         189  
7              
8 5     5   29 use Venus::Class 'base';
  5         10  
  5         31  
9              
10             base 'Faker::Plugin::EnUs';
11              
12             # VERSION
13              
14             our $VERSION = '1.17';
15              
16             # METHODS
17              
18             sub execute {
19 23     23 1 1187 my ($self, $data) = @_;
20              
21 23         89 my $domain_word = lc $self->faker->company_name;
22              
23 23         1658 $domain_word =~ s/\W+/-/g;
24 23         5552 $domain_word =~ s/^\W+|\W+$//g;
25              
26 23         150 return $domain_word;
27             }
28              
29             1;
30              
31              
32              
33             =head1 NAME
34              
35             Faker::Plugin::EnUs::InternetDomainWord - Internet Domain Word
36              
37             =cut
38              
39             =head1 ABSTRACT
40              
41             Internet Domain Word for Faker
42              
43             =cut
44              
45             =head1 VERSION
46              
47             1.17
48              
49             =cut
50              
51             =head1 SYNOPSIS
52              
53             package main;
54              
55             use Faker::Plugin::EnUs::InternetDomainWord;
56              
57             my $plugin = Faker::Plugin::EnUs::InternetDomainWord->new;
58              
59             # bless(..., "Faker::Plugin::EnUs::InternetDomainWord")
60              
61             =cut
62              
63             =head1 DESCRIPTION
64              
65             This package provides methods for generating fake data for internet domain word.
66              
67             =encoding utf8
68              
69             =cut
70              
71             =head1 INHERITS
72              
73             This package inherits behaviors from:
74              
75             L
76              
77             =cut
78              
79             =head1 METHODS
80              
81             This package provides the following methods:
82              
83             =cut
84              
85             =head2 execute
86              
87             execute(HashRef $data) (Str)
88              
89             The execute method returns a returns a random fake internet domain word.
90              
91             I>
92              
93             =over 4
94              
95             =item execute example 1
96              
97             package main;
98              
99             use Faker::Plugin::EnUs::InternetDomainWord;
100              
101             my $plugin = Faker::Plugin::EnUs::InternetDomainWord->new;
102              
103             # bless(..., "Faker::Plugin::EnUs::InternetDomainWord")
104              
105             # my $result = $plugin->execute;
106              
107             # "bode-and-sons";
108              
109             # my $result = $plugin->execute;
110              
111             # "mayer-balistreri-and-miller";
112              
113             # my $result = $plugin->execute;
114              
115             # "kerluke-waelchi";
116              
117             =back
118              
119             =cut
120              
121             =head2 new
122              
123             new(HashRef $data) (Plugin)
124              
125             The new method returns a new instance of the class.
126              
127             I>
128              
129             =over 4
130              
131             =item new example 1
132              
133             package main;
134              
135             use Faker::Plugin::EnUs::InternetDomainWord;
136              
137             my $plugin = Faker::Plugin::EnUs::InternetDomainWord->new;
138              
139             # bless(..., "Faker::Plugin::EnUs::InternetDomainWord")
140              
141             =back
142              
143             =cut