| 1 | |||||||||||
| 2 | package Class::DBI::Lite::ColumnInfo; | ||||||||||
| 3 | |||||||||||
| 4 | 16 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | 16 | ▶ | use warnings 'all'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | |||||||||||
| 7 | |||||||||||
| 8 | #============================================================================== | ||||||||||
| 9 | sub new | ||||||||||
| 10 | 24 | ▶ | { | ||||||||
|
Subroutine
new: called CC=3 SCAR=11.1
Pod
undocumented
| |||||||||||
| 11 | 24 | my ($class, %args) = @_; | |||||||||
| 12 | |||||||||||
| 13 | 24 | my @required = qw( | |||||||||
| 14 | name | ||||||||||
| 15 | type | ||||||||||
| 16 | length | ||||||||||
| 17 | is_nullable | ||||||||||
| 18 | default_value | ||||||||||
| 19 | is_pk | ||||||||||
| 20 | key | ||||||||||
| 21 | ); | ||||||||||
| 22 | |||||||||||
| 23 | 24 | foreach( @required ) | |||||||||
| 24 | { | ||||||||||
| 25 | die "Required parameter '$_' was not provided" | ||||||||||
| 26 | 168 | ▶ | unless exists($args{$_}); | ||||||||
|
Branch: 1 branch
| |||||||||||
| 27 | }# end foreach() | ||||||||||
| 28 | |||||||||||
| 29 | 24 | return bless \%args, $class; | |||||||||
| 30 | }# end new() | ||||||||||
| 31 | |||||||||||
| 32 | 2 | ▶ | sub null { $_[0]->{is_nullable} } | ||||||||
|
Subroutine
null: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 33 | 1 | ▶ | sub default { $_[0]->{default_value} } | ||||||||
|
Subroutine
default: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 34 | 0 | ▶ | sub enum_values { shift->{enum_values} } | ||||||||
|
Subroutine
enum_values: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 35 | |||||||||||
| 36 | |||||||||||
| 37 | #============================================================================== | ||||||||||
| 38 | sub AUTOLOAD | ||||||||||
| 39 | 1 | ▶ | { | ||||||||
|
Subroutine
AUTOLOAD: called CC=2 SCAR=7.0
| |||||||||||
| 40 | 1 | my $s = shift; | |||||||||
| 41 | 1 | our $AUTOLOAD; | |||||||||
| 42 | 1 | my ($key) = $AUTOLOAD =~ m/([^:]+)$/; | |||||||||
| 43 | |||||||||||
| 44 | 1 | ▶ | return exists($s->{$key}) ? $s->{$key} : die "Invalid field '$key'"; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 45 | }# end AUTOLOAD() | ||||||||||
| 46 | 0 | ▶ | sub DESTROY {} | ||||||||
|
Subroutine
DESTROY: not called CC=1 SCAR=0.0
| |||||||||||
| 47 | |||||||||||
| 48 | 16 | 1;# return true: | |||||||||
| 49 | |||||||||||
| 50 | __END__ | ||||||||||