File Coverage

blib/lib/MooseX/SingleArg/Meta/Object.pm
Criterion Covered Total %
statement 6 6 100.0
branch n/a
condition n/a
subroutine 2 2 100.0
pod n/a
total 8 8 100.0


line stmt bran cond sub pod time code
1            
2            
3 2     2   19333

perltidy

  2         4  
  2         17  
4            
 
5 2     2   12634 package # Hide from the indexer. MooseX::SingleArg::Meta::Object; use Moose::Role; use Carp qw( croak ); around BUILDARGS => sub{ my $orig = shift; my $class = shift; my $meta = $class->meta(); croak("single_arg() has not been called for $class") if !$meta->has_single_arg(); my $force = $meta->force_single_arg(); croak("$class accepts only one argument") if $force and @_>1; if (@_==1 and ($force or ref($_[0]) ne 'HASH')) { return $class->$orig( $meta->single_arg() => $_[0] ); } return $class->$orig( @_ ); }; 1;
  2         6  
  2         505