lib/SVG/Estimate/Polygon.pm

filter: Statementstmt 100% 18 / 18 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 4 / 4 Podpod n/a totaltotal 100% 22 / 22 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« lib/SVG/Estimate.pm ↑ Summary lib/SVG/Estimate/Role/Pythagorean.pm »
1 package SVG::Estimate::Polygon;
2 8 $SVG::Estimate::Polygon::VERSION = '1.0111';
3 8 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 8 ▶use Math::Trig qw/pi/;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 8 ▶use Clone qw/clone/;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 8 extends 'SVG::Estimate::Polyline';
8  
9 =head1 NAME
10  
11 SVG::Estimate::Polygon - Handles estimating shapes of more than 3 points with straight lines between the points.
12  
13 =head1 VERSION
14  
15 version 1.0111
16  
17 =head1 SYNOPSIS
18  
19 my $polygon = SVG::Estimate::Polygon->new(
20 transformer => $transform,
21 start_point => [45,13],
22 points => '20,20 40,25 60,40 80,120 120,140 200,180',
23 );
24  
25 my $length = $polygon->length;
26  
27 =head1 INHERITANCE
28  
29 This class extends L<SVG::Estimate::Polyline>.
30  
31 =cut
32  
33 ##Take the first pair, and make it the last to close the shape.
34 around _get_pairs => sub {
35 4 ▶ my $orig = shift;
Subroutine __ANON__: called CC=1 SCAR=0.0
36 4 my $self = shift;
37 4 my @points = $self->$orig(@_);
38 4 push @points, $points[0];
39 return @points
40 4 };
41  
42 8 1;
« lib/SVG/Estimate.pm ↑ Summary lib/SVG/Estimate/Role/Pythagorean.pm »