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 18     18   151 use strict;
  18         50  
  18         548  
4 18     18   105 use warnings;
  18         46  
  18         536  
5 18     18   106 use base 'Class::Accessor::Grouped';
  18         51  
  18         2317  
6 18     18   136 use mro 'c3';
  18         57  
  18         213  
7 18     18   639 use Carp::Clan qw/^DBIx::Class/;
  18         57  
  18         192  
8 18     18   2318 use Scalar::Util 'weaken';
  18         42  
  18         947  
9 18     18   136 use namespace::clean;
  18         47  
  18         187  
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 12001     12001   68746 '""' => sub { $_[0]->name }, 34 999     999   1990 '@{}' => sub { [ @{$_[0]->table->name_parts}, $_[0]->name ] },   999         5078   35 18     18   7349 fallback => 1;   18         53     18         325   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 2201     2201 1 5245 my $class = shift; 47               48 2201         6698 my $self = { @_ }; 49 2201 50       8287 croak "table is required" unless ref $self->{table}; 50               51 2201         9288 weaken $self->{table}; 52               53 2201         6822 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;