File Coverage

examples/neo-makemaker/inc/My/NeoDynDepsLite.pm
Criterion Covered Total %
statement 15 16 93.7
branch 1 2 50.0
condition 1 2 50.0
subroutine 5 5 100.0
pod 0 2 0.0
total 22 27 81.4


line stmt bran cond sub pod time code
1 1     1   1054 use 5.006;
  1         3  
2 1     1   4 use strict;
  1         1  
  1         17  
3 1     1   2 use warnings;
  1         2  
  1         119  
4              
5             package inc::My::NeoDynDepsLite;
6              
7             # ABSTRACT: A Lightweight injector thingy
8              
9             # AUTHORITY
10              
11             # Look ma, no Dzil! no Moose! Nothing!
12              
13 2 50   2 0 383 sub new { return bless { ref $_[1] ? %{ $_[1] } : @_[ 1 .. $#_ ] }, $_[0] }
  0         0  
14              
15             # This is obviously a rediculously tiny and simple big of code
16             # in comparison with the normal shenanigans.
17             sub inject_prelude {
18 2     2 0 3 my ( $self, $event ) = @_;
19 2         51 my $text = $event->prelude;
20 2   50     10 my $letter = $self->{letter} || 'H';
21 2         6 $text .= <<"EOF";
22             print "This message brought to you by the letter $letter";
23             EOF
24 2         51 $event->prelude($text);
25 2         4 return;
26             }
27              
28             1;