blib/lib/Yukki/Web/View/Role/Navigation.pm untested

filter: Statementstmt 0.0% 0 / 19 Branchbran 0.0% 0 / 2 Conditioncond 0.0% 0 / 7 MC/DCmcdc 0.0% 0 / 3 Subroutinesub 0.0% 0 / 4 Podpod 0.0% 0 / 1 totaltotal 0.0% 0 / 36 CC 2 SCAR 12.8
CC
2
Cov
0%
page_navigation
6.0
BEGIN
2.0
BEGIN
2.0
CRAP 3.6
1 package Yukki::Web::View::Role::Navigation;
2 $Yukki::Web::View::Role::Navigation::VERSION = '0.991_007'; # TRIAL
3 $Yukki::Web::View::Role::Navigation::VERSION = '0.991007';
4 use v5.24;
5 use Moo::Role;
6  
7 use String::Errf qw( errf );
8  
9 # ABSTRACT: Common page navigation tools for views
10  
11  
12 requires 'standard_menu';
13  
14  
15 sub page_navigation {
16 my ($self, $response, $this_action, $vars) = @_;
17  
18 for my $menu_item ($self->standard_menu) {
19 next if $this_action eq $menu_item->{action};
20  
21 $response->add_navigation_item([ qw( page page_bottom ) ], {
22 label => $menu_item->{label} // ucfirst $menu_item->{action},
23 href => errf($menu_item->{href}, $vars // {}),
24 sort => $menu_item->{sort} // 20,
25 });
26 }
27 }
28  
29 1;
30  
31 __END__