File Coverage

blib/lib/Bootylicious/Decorator.pm
Criterion Covered Total %
statement 21 21 100.0
branch 3 6 50.0
condition n/a
subroutine 5 5 100.0
pod 1 1 100.0
total 30 33 90.9


line stmt bran cond sub pod time code
1             package Bootylicious::Decorator;
2              
3 16     16   90 use strict;
  16         22  
  16         518  
4 16     16   107 use warnings;
  16         24  
  16         399  
5              
6 16     16   63 use base 'Mojo::Base';
  16         18  
  16         4873  
7              
8             __PACKAGE__->attr('object');
9              
10             sub new {
11 53     53 1 1023 my $class = shift;
12 53         82 my $object = shift;
13              
14 53         251 my $self = $class->SUPER::new(@_);
15              
16 53         524 $self->object($object);
17              
18 53         490 return $self;
19             }
20              
21             our $AUTOLOAD;
22              
23             sub AUTOLOAD {
24 132     132   14500 my $self = shift;
25              
26 132         182 my $method = $AUTOLOAD;
27              
28 132 50       684 return if $method =~ /^[A-Z]+?$/;
29 132 50       288 return if $method =~ /^_/;
30 132 50       295 return if $method =~ /(?:\:*?)DESTROY$/;
31              
32 132         456 $method = (split '::' => $method)[-1];
33              
34 132         429 return $self->object->$method(@_);
35             }
36              
37             1;