File Coverage

blib/lib/DBIx/Class/CDBICompat/Stringify.pm
Criterion Covered Total %
statement 12 19 63.1
branch 0 4 0.0
condition 0 3 0.0
subroutine 4 6 66.6
pod 0 1 0.0
total 16 33 48.4


line stmt bran cond sub pod time code
1             package # hide from PAUSE
2             DBIx::Class::CDBICompat::Stringify;
3              
4 2     2   766 use strict;
  2         4  
  2         48  
5 2     2   9 use warnings;
  2         5  
  2         57  
6              
7 2     2   15 use base 'DBIx::Class';
  2         4  
  2         212  
8              
9             use overload
10 0     0     '""' => sub { return shift->stringify_self; },
11 2     2   13 fallback => 1;
  2         3  
  2         19  
12              
13             sub stringify_self {
14 0     0 0   my $self = shift;
15 0           my @cols = $self->columns('Stringify');
16 0 0         @cols = $self->primary_column unless @cols;
17 0 0         my $ret = join "/", map { $self->get_column($_) || '' } @cols;
  0            
18 0   0       return $ret || ref $self;
19             }
20              
21             1;