blib/lib/HTML/Latemp/NavLinks/GenHtml.pm

filter: Statementstmt 100% 31 / 31 Branchbran 50.0% 1 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 7 / 7 Podpod 100% 1 / 1 totaltotal 97.5% 40 / 41 CC 3 SCAR 5.1
CC
3
Cov
97%
_get_buttons
3.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.7
« Build ↑ Summary blib/lib/HTML/Latemp/NavLinks/GenHtml/Text.pm »
1 package HTML::Latemp::NavLinks::GenHtml;
2  
3 6 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 6 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 6 ▶use 5.008;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 6 ▶use parent 'Class::Accessor';
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 6 __PACKAGE__->mk_accessors(qw(
11 nav_links_obj
12 root
13 ));
14  
15  
16 6 our $VERSION = '0.2.6';
17  
18  
19 sub new
20 {
21 2 ▶ my $class = shift;
Subroutine new: called CC=1 SCAR=0.0
Pod documented
22 2 my $self = {};
23 2 bless $self, $class;
24 2 $self->_init(@_);
25 2 return $self;
26 }
27  
28 sub _init
29 {
30 2 ▶ my $self = shift;
Subroutine _init: called CC=1 SCAR=0.0
31 2 my (%args) = @_;
32  
33 2 $self->root($args{root});
34 2 $self->nav_links_obj($args{nav_links_obj});
35  
36 2 return $self;
37 }
38  
39  
40 sub _get_buttons
41 {
42 2 ▶ my $self = shift;
Subroutine _get_buttons: called CC=3 SCAR=11.0
43  
44 2 my @buttons =
45 (
46 {
47 'dir' => "prev",
48 'button' => "left",
49 'title' => "Previous Page",
50 },
51 {
52 'dir' => "up",
53 'button' => "up",
54 'title' => "Up in the Site",
55 },
56 {
57 'dir' => "next",
58 'button' => "right",
59 'title' => "Next Page",
60 },
61 );
62  
63 2 foreach my $button (@buttons)
64 {
65 6 my $dir = $button->{'dir'};
66 6 ▶ if ($button->{'exists'} = exists($self->nav_links_obj->{$dir}))
Branch: 1 branch
BranchTrueFalseTotal
if ($button->{"exists"} = exists $self->nav_links_obj->{$dir}) 6 0 6
67 {
68 6 $button->{'link_obj'} = $self->nav_links_obj->{$dir};
69 }
70 }
71  
72 2 return \@buttons;
73 }
74  
75  
76 6 1;
77  
78 __END__
« Build ↑ Summary blib/lib/HTML/Latemp/NavLinks/GenHtml/Text.pm »