File Coverage

blib/lib/App/PerlWatcher/Describable.pm
Criterion Covered Total %
statement 14 14 100.0
branch n/a
condition n/a
subroutine 5 5 100.0
pod 1 1 100.0
total 20 20 100.0


line stmt bran cond sub pod time code
1             package App::PerlWatcher::Describable;
2             {
3             $App::PerlWatcher::Describable::VERSION = '0.20';
4             }
5             # ABSTRACT: The base role for providing description for UI
6              
7 11     11   12078 use 5.12.0;
  11         75  
  11         521  
8 11     11   65 use strict;
  11         25  
  11         379  
9 11     11   60 use warnings;
  11         21  
  11         336  
10              
11 11     11   52 use Moo::Role;
  11         21  
  11         99  
12              
13              
14             requires 'description';
15              
16              
17             requires 'start';
18              
19              
20              
21             has 'describer' => ( is => 'ro', default => sub { return sub { $_[0]; }; }, );
22              
23              
24              
25             sub describe {
26 8     8 1 29 my $self = shift;
27 8         49 return $self->describer->($self->description);
28             }
29              
30             1;
31              
32             __END__