Faker/Plugin/InternetIpAddressV4.pm

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