| 1 | package Valiemon::Attributes; | ||||||||||
| 2 | 25 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 3 | 25 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 25 | ▶ | use utf8; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | |||||||||||
| 6 | 25 | ▶ | use Carp qw(croak); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 7 | 25 | ▶ | use Exporter qw(import); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 8 | 25 | ▶ | use Class::Load qw(is_class_loaded try_load_class); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 9 | 25 | ▶ | use Valiemon::ValidationError; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 10 | |||||||||||
| 11 | 25 | our @EXPORT_OK = qw(attr); | |||||||||
| 12 | |||||||||||
| 13 | sub attr { | ||||||||||
| 14 | 1300 | ▶ | my ($name) = @_; | ||||||||
|
Subroutine
attr: called CC=3 SCAR=11.0
Pod
undocumented
| |||||||||||
| 15 | 1300 | $name =~ s/^\$//; # TODO have package mappings instead of dinamic load | |||||||||
| 16 | 1300 | my $class = join '::', __PACKAGE__, (ucfirst $name); | |||||||||
| 17 | 1300 | ▶ | return $class if is_class_loaded($class); | ||||||||
|
Branch: 1 branch
| |||||||||||
| 18 | |||||||||||
| 19 | 204 | my ($is_success) = try_load_class($class); | |||||||||
| 20 | 203 | ▶ | return $is_success ? $class : undef; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 21 | } | ||||||||||
| 22 | |||||||||||
| 23 | sub attr_name { | ||||||||||
| 24 | 0 | ▶ | croak '`attr_name` method must be implemented'; | ||||||||
|
Subroutine
attr_name: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||
| 25 | } | ||||||||||
| 26 | |||||||||||
| 27 | sub is_valid { | ||||||||||
| 28 | 0 | ▶ | my ($class, $context, $schema, $data) = @_; | ||||||||
|
Subroutine
is_valid: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||
| 29 | 0 | croak '`is_valid` method must be implemented'; | |||||||||
| 30 | } | ||||||||||
| 31 | |||||||||||
| 32 | 25 | 1; | |||||||||