blib/lib/DBIO/Test/MooSchema/Result/Artist.pm

filter: Statementstmt 100% 20 / 20 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 5 / 5 Podpod n/a totaltotal 100% 25 / 25 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« blib/lib/DBIO/Test/MooSchema.pm ↑ Summary blib/lib/DBIO/Test/MooseSchema/Result/Artist.pm »
1 package DBIO::Test::MooSchema::Result::Artist;
2 # ABSTRACT: Moo-enabled test result class for the artist table
3  
4 4 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 4 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 4 our $VERSION = '0.900007';
8  
9 4 ▶use DBIO::Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 4 __PACKAGE__->table('artist');
12 4 __PACKAGE__->add_columns(
13 id => { data_type => 'integer', is_auto_increment => 1 },
14 name => { data_type => 'varchar', size => 100, is_nullable => 0 },
15 );
16 4 __PACKAGE__->set_primary_key('id');
17 4 __PACKAGE__->resultset_class('DBIO::Test::MooSchema::ResultSet::Artist');
18  
19 4 __PACKAGE__->has_many(
20 cds => 'DBIO::Test::MooSchema::Result::CD', 'artist_id'
21 );
22  
23 # Lazy Moo attribute — computed from column data on first access
24 4 has display_name => ( is => 'lazy' );
25 1 ▶sub _build_display_name { 'Artist: ' . $_[0]->name }
Subroutine _build_display_name: called CC=1 SCAR=0.0
26  
27 # Moo rw attribute with a lazy default (must be lazy — inflate_result bypasses new())
28 1 ▶has score => ( is => 'rw', lazy => 1, default => sub { 0 } );
Subroutine __ANON__: called CC=1 SCAR=0.0
29  
30 4 1;
31  
32 __END__
« blib/lib/DBIO/Test/MooSchema.pm ↑ Summary blib/lib/DBIO/Test/MooseSchema/Result/Artist.pm »