File Coverage

blib/lib/DBIx/Class/Schema/Loader/Column.pm
Criterion Covered Total %
statement 32 32 100.0
branch 1 2 50.0
condition n/a
subroutine 11 11 100.0
pod 1 1 100.0
total 45 46 97.8


line stmt bran cond sub pod time code
1             package DBIx::Class::Schema::Loader::Column;
2              
3 52     52   366 use strict;
  52         113  
  52         2215  
4 52     52   289 use warnings;
  52         149  
  52         3881  
5 52     52   405 use base 'Class::Accessor::Grouped';
  52         110  
  52         11142  
6 52     52   423 use mro 'c3';
  52         198  
  52         457  
7 52     52   2168 use Carp::Clan qw/^DBIx::Class/;
  52         188  
  52         642  
8 52     52   7667 use Scalar::Util 'weaken';
  52         115  
  52         3677  
9 52     52   377 use namespace::clean;
  52         116  
  52         577  
10              
11             =head1 NAME
12              
13             DBIx::Class::Schema::Loader::Column - Class for Columns in
14             L
15              
16             =head1 DESCRIPTION
17              
18             Used for representing columns in
19             L.
20              
21             Stringifies to L, and arrayrefifies to the
22             L of
23             L
plus L. 24               25             =cut 26               27             __PACKAGE__->mk_group_accessors(simple => qw/ 28             table 29             name 30             /); 31               32             use overload 33 12451     12451   87380 '""' => sub { $_[0]->name }, 34 999     999   2412 '@{}' => sub { [ @{$_[0]->table->name_parts}, $_[0]->name ] },   999         6687   35 52     52   24918 fallback => 1;   52         165     52         682   36               37             =head1 METHODS 38               39             =head2 new 40               41             The constructor. Takes L and L key-value parameters. 42               43             =cut 44               45             sub new { 46 2385     2385 1 6047 my $class = shift; 47               48 2385         8748 my $self = { @_ }; 49 2385 50       10373 croak "table is required" unless ref $self->{table}; 50               51 2385         6778 weaken $self->{table}; 52               53 2385         9157 return bless $self, $class; 54             } 55               56             =head2 table 57               58             The L object this column belongs to. 59             Required parameter for L 60               61             =head2 name 62               63             The name of the column. Required parameter for L. 64               65             =cut 66               67             1;