blib/lib/DBIO/Test/MooseSugarSchema/Result/CD.pm

filter: Statementstmt 100% 3 / 3 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 1 / 1 Podpod n/a totaltotal 100% 4 / 4 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
CRAP 1.0
« blib/lib/DBIO/Test/MooseSugarSchema/Result/Artist.pm ↑ Summary blib/lib/DBIO/Test/Namespace/OtherRslt/D.pm »
1 package DBIO::Test::MooseSugarSchema::Result::CD;
2 # ABSTRACT: Moose + Cake test result class for the cd table (no custom ResultSet)
3  
4 our $VERSION = '0.900007';
5  
6 2 ▶use DBIO::Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 use DBIO::Cake;
8  
9 table 'cd';
10  
11 col id => integer auto_inc;
12 col artist_id => integer;
13 col title => varchar(100);
14 col year => integer null;
15  
16 primary_key 'id';
17  
18 __PACKAGE__->belongs_to( artist => 'DBIO::Test::MooseSugarSchema::Result::Artist', 'artist_id' );
19  
20 has full_title => (
21 is => 'ro',
22 isa => 'Str',
23 lazy => 1,
24 builder => '_build_full_title',
25 );
26 sub _build_full_title {
27 my $self = shift;
28 my $year = $self->year // '?';
29 sprintf '%s (%s)', $self->title, $year;
30 }
31  
32 has rating => ( is => 'rw', isa => 'Int', lazy => 1, default => 0 );
33  
34 __PACKAGE__->meta->make_immutable;
35  
36 1;
37  
38 __END__
« blib/lib/DBIO/Test/MooseSugarSchema/Result/Artist.pm ↑ Summary blib/lib/DBIO/Test/Namespace/OtherRslt/D.pm »