KiokuDB/TypeMap/Entry/DBIC/ResultSource.pm

filter: Statementstmt 96.5% 28 / 29 Branchbran 50.0% 1 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 90.0% 9 / 10 Podpod 0.0% 0 / 1 totaltotal 90.4% 38 / 42 CC 2 SCAR 1.9
CC
2
Cov
94%
__ANON__
2.1
__ANON__
1.0
compile
1.0
CRAP 1.2
« KiokuDB/TypeMap/Entry/DBIC/Schema.pm ↑ Summary KiokuDB/TypeMap/Entry/DBIC/ResultSet.pm »
1 package KiokuDB::TypeMap::Entry::DBIC::ResultSource;
2 7 ▶BEGIN {
Subroutine BEGIN: called CC=1 SCAR=0.0
3 7 $KiokuDB::TypeMap::Entry::DBIC::ResultSource::AUTHORITY = 'cpan:NUFFIN';
4 }
5 7 $KiokuDB::TypeMap::Entry::DBIC::ResultSource::VERSION = '1.23';
6 7 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 # ABSTRACT: KiokuDB::TypeMap::Entry for DBIx::Class::ResultSource objects.
8  
9 7 ▶use Scalar::Util qw(weaken refaddr);
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 7 ▶use namespace::autoclean;
Subroutine BEGIN: called CC=1 SCAR=0.0
12  
13 7 with qw(KiokuDB::TypeMap::Entry);
14  
15 2 ▶sub compile {
Subroutine compile: called CC=1 SCAR=0.0
Pod undocumented
16 2 my ( $self, $class ) = @_;
17  
18 return KiokuDB::TypeMap::Entry::Compiled->new(
19 1 ▶ collapse_method => sub {
Subroutine __ANON__: called CC=1 SCAR=0.2
20 1 my ( $collapser, @args ) = @_;
21  
22 $collapser->collapse_first_class(
23 1 ▶ sub {
Subroutine __ANON__: called CC=2 SCAR=7.6
24 1 my ( $collapser, %args ) = @_;
25  
26 1 ▶ if ( refaddr($collapser->backend->schema) == refaddr($args{object}->schema) ) {
Branch: 1 branch
BranchTrueFalseTotal
if (builtin::refaddr($collapser->backend->schema) == builtin::refaddr($args{'object'}->schema)) { } 1 0 1
27 1 return $collapser->make_entry(
28 %args,
29 data => undef,
30 meta => {
31 immortal => 1,
32 },
33 );
34 } else {
35 0 croak("Referring to foreign DBIC schemas is unsupported");
36 }
37 },
38 1 @args,
39 );
40 },
41 1 ▶ expand_method => sub {
Subroutine __ANON__: called CC=1 SCAR=0.0
42 1 my ( $linker, $entry ) = @_;
43  
44 1 my $schema = $linker->backend->schema;
45  
46 1 my $rs = $schema->source(substr($entry->id, length('dbic:schema:rs:')));
47  
48 1 $linker->register_object( $entry => $rs, immortal => 1 );
49  
50 1 return $rs;
51 },
52 1 ▶ id_method => sub {
Subroutine __ANON__: called CC=1 SCAR=0.0
53 1 my ( $self, $object ) = @_;
54  
55 1 return 'dbic:schema:rs:' . $object->source_name;
56 },
57 0 ▶ refresh_method => sub { },
Subroutine __ANON__: not called CC=1 SCAR=0.0
58 2 entry => $self,
59 class => $class,
60 );
61 }
62  
63  
64 7 __PACKAGE__->meta->make_immutable;
65  
66 # ex: set sw=4 et:
67  
68 7 __PACKAGE__
69  
70 __END__
« KiokuDB/TypeMap/Entry/DBIC/Schema.pm ↑ Summary KiokuDB/TypeMap/Entry/DBIC/ResultSet.pm »