| 1 | package Digital::Role; | ||||||||||||||||||||||||||||
| 2 | 3 | our $AUTHORITY = 'cpan:GETTY'; | |||||||||||||||||||||||||||
| 3 | # ABSTRACT: Base role for Digital driver (positive integer input) | ||||||||||||||||||||||||||||
| 4 | 3 | $Digital::Role::VERSION = '0.003'; | |||||||||||||||||||||||||||
| 5 | 3 | ▶ | use Moo::Role; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 6 | 3 | ▶ | use Carp qw( croak ); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 7 | |||||||||||||||||||||||||||||
| 8 | 2 | ▶ | sub input { | ||||||||||||||||||||||||||
|
Subroutine
input: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||
| 9 | 2 | my ( $class, $input, %args ) = @_; | |||||||||||||||||||||||||||
| 10 | 2 | return $class->new( in => $input, %args ); | |||||||||||||||||||||||||||
| 11 | } | ||||||||||||||||||||||||||||
| 12 | |||||||||||||||||||||||||||||
| 13 | has in => ( | ||||||||||||||||||||||||||||
| 14 | is => 'ro', | ||||||||||||||||||||||||||||
| 15 | 2 | ▶ | isa => sub { | ||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=3 SCAR=14.2
| |||||||||||||||||||||||||||||
| 16 | 2 | ▶ | croak "Digital input must be positive integer!" | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
$_[0] =~ /^\d+$/ and $_[0] >= 0
MC/DC0%0/2
$_[0] =~ /^\d+$/ and $_[0] >= 0
$_[0] =~ /^\d+$/
$_[0] >= 0
Truth table33%1/3
A and B
A= $_[0] =~ /^\d+$/B= $_[0] >= 0
| |||||||||||||||||||||||||||||
| 17 | unless $_[0] =~ /^\d+$/ and $_[0] >= 0; | ||||||||||||||||||||||||||||
| 18 | }, | ||||||||||||||||||||||||||||
| 19 | 3 | required => 1, | |||||||||||||||||||||||||||
| 20 | ); | ||||||||||||||||||||||||||||
| 21 | |||||||||||||||||||||||||||||
| 22 | 3 | 1; | |||||||||||||||||||||||||||
| 23 | |||||||||||||||||||||||||||||
| 24 | __END__ | ||||||||||||||||||||||||||||