| 1 | package Class::DBI::Plugin::Param; | ||||||||||
| 2 | |||||||||||
| 3 | 3 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 3 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | 3 | ▶ | use Carp; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | |||||||||||
| 7 | 3 | our $VERSION = '0.03'; | |||||||||
| 8 | |||||||||||
| 9 | 2 | ▶ | sub import { | ||||||||
|
Subroutine
import: called CC=2 SCAR=7.9
| |||||||||||
| 10 | 2 | my $class = shift; | |||||||||
| 11 | 2 | my $callpkg = caller; | |||||||||
| 12 | 2 | ▶ | die "This module only works correctly under a subclass of Class::DBI" | ||||||||
|
Branch: 1 branch
| |||||||||||
| 13 | unless ($callpkg->isa('Class::DBI')); | ||||||||||
| 14 | { | ||||||||||
| 15 | 3 | ▶ | no strict 'refs'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 16 | 2 | ▶ | *{$callpkg."::param"} = sub { | ||||||||
|
Subroutine
__ANON__: not called CC=2 SCAR=14.6
| |||||||||||
| 17 | 0 | my $self = shift; | |||||||||
| 18 | 0 | ▶ | my $column_name = shift or | ||||||||
|
Branch: 1 branch
| |||||||||||
| 19 | croak "You gave me no parameters to param()!"; | ||||||||||
| 20 | 0 | return $self->$column_name(@_); | |||||||||
| 21 | } | ||||||||||
| 22 | 2 | } | |||||||||
| 23 | } | ||||||||||
| 24 | |||||||||||
| 25 | 3 | 1; | |||||||||
| 26 | |||||||||||
| 27 | __END__ | ||||||||||