File Coverage

blib/lib/DBIx/Class/AccessorGroup.pm
Criterion Covered Total %
statement 28 28 100.0
branch 4 4 100.0
condition 3 3 100.0
subroutine 8 8 100.0
pod 2 2 100.0
total 45 45 100.0


line stmt bran cond sub pod time code
1             package DBIx::Class::AccessorGroup;
2              
3 380     380   2317 use strict;
  380         762  
  380         11086  
4 380     380   1674 use warnings;
  380         733  
  380         10790  
5              
6 380     380   1690 use base qw/Class::Accessor::Grouped/;
  380         709  
  380         221620  
7 380     380   2684556 use Scalar::Util qw/weaken blessed/;
  380         1173  
  380         21459  
8 380     380   1935 use namespace::clean;
  380         3142  
  380         2664  
9              
10             my $successfully_loaded_components;
11              
12             sub get_component_class {
13 104073     104073 1 750927 my $class = $_[0]->get_inherited($_[1]);
14              
15             # It's already an object, just go for it.
16 104073 100       922037 return $class if blessed $class;
17              
18 104071 100 100     450142 if (defined $class and ! $successfully_loaded_components->{$class} ) {
19 25337         65468 $_[0]->ensure_class_loaded($class);
20              
21 380     380   104461 no strict 'refs';
  380         786  
  380         48112  
22             $successfully_loaded_components->{$class}
23 25336         104815 = ${"${class}::__LOADED__BY__DBIC__CAG__COMPONENT_CLASS__"}
24 25336         356923 = do { \(my $anon = 'loaded') };
  25336         34474  
25 25336         58453 weaken($successfully_loaded_components->{$class});
26             }
27              
28 104070         397230 $class;
29             };
30              
31             sub set_component_class {
32 1948     1948 1 460217 shift->set_inherited(@_);
33             }
34              
35             1;
36              
37             =head1 NAME
38              
39             DBIx::Class::AccessorGroup - See Class::Accessor::Grouped
40              
41             =head1 SYNOPSIS
42              
43             =head1 DESCRIPTION
44              
45             This class now exists in its own right on CPAN as Class::Accessor::Grouped
46              
47             =head1 FURTHER QUESTIONS?
48              
49             Check the list of L.
50              
51             =head1 COPYRIGHT AND LICENSE
52              
53             This module is free software L
54             by the L. You can
55             redistribute it and/or modify it under the same terms as the
56             L.
57              
58             =cut