line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Device::WallyHome::Role::Validator; |
2
|
2
|
|
|
2
|
|
1474
|
use Moose::Role; |
|
2
|
|
|
|
|
21
|
|
|
2
|
|
|
|
|
15
|
|
3
|
2
|
|
|
2
|
|
9092
|
use MooseX::AttributeShortcuts; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
27
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
our $VERSION = 0.01; |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
#== PRIVATE METHODS ============================================================ |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub _checkRequiredScalarParam { |
11
|
3
|
|
|
3
|
|
9
|
my ($self, $value, $paramName) = @_; |
12
|
|
|
|
|
|
|
|
13
|
3
|
|
50
|
|
|
15
|
$paramName //= 'parameter'; |
14
|
|
|
|
|
|
|
|
15
|
3
|
50
|
|
|
|
14
|
die $paramName . ' required' unless defined $value; |
16
|
|
|
|
|
|
|
|
17
|
3
|
50
|
|
|
|
16
|
die 'valid ' . $paramName . ' required' if ref($value); |
18
|
|
|
|
|
|
|
} |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
1; |