| 1 | package Role::Identifiable::HasIdent 0.009; | ||||||||||||||||||||||||||||
| 2 | 1 | ▶ | use Moose::Role; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 3 | # ABSTRACT: a thing with an ident attribute | ||||||||||||||||||||||||||||
| 4 | |||||||||||||||||||||||||||||
| 5 | #pod =head1 DESCRIPTION | ||||||||||||||||||||||||||||
| 6 | #pod | ||||||||||||||||||||||||||||
| 7 | #pod This is an incredibly simple role. It adds a required C<ident> attribute that | ||||||||||||||||||||||||||||
| 8 | #pod stores a simple string, meant to identify exceptions. | ||||||||||||||||||||||||||||
| 9 | #pod | ||||||||||||||||||||||||||||
| 10 | #pod The string has to contain at least one character, and it can't start or end | ||||||||||||||||||||||||||||
| 11 | #pod with whitespace. | ||||||||||||||||||||||||||||
| 12 | #pod | ||||||||||||||||||||||||||||
| 13 | #pod =cut | ||||||||||||||||||||||||||||
| 14 | |||||||||||||||||||||||||||||
| 15 | 1 | ▶ | use Moose::Util::TypeConstraints; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 16 | |||||||||||||||||||||||||||||
| 17 | has ident => ( | ||||||||||||||||||||||||||||
| 18 | is => 'ro', | ||||||||||||||||||||||||||||
| 19 | 5 | ▶ | isa => subtype('Str', where { length && /\A\S/ && /\S\z/ }), | ||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=3 SCAR=11.0
Branch: 1 branch
Condition100%3/3
length $_ and /\A\S/
MC/DC100%2/2
length $_ and /\A\S/
length $_
/\A\S/
Truth table100%3/3
A and B
A= length $_B= /\A\S/
| |||||||||||||||||||||||||||||
| 20 | required => 1, | ||||||||||||||||||||||||||||
| 21 | ); | ||||||||||||||||||||||||||||
| 22 | |||||||||||||||||||||||||||||
| 23 | 1 | ▶ | no Moose::Role; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 24 | 1 | ▶ | use Moose::Util::TypeConstraints; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 25 | 1 | 1; | |||||||||||||||||||||||||||
| 26 | |||||||||||||||||||||||||||||
| 27 | __END__ | ||||||||||||||||||||||||||||