File Coverage

blib/lib/Role/Identifiable/HasIdent.pm
Criterion Covered Total %
statement 12 12 100.0
branch n/a
condition n/a
subroutine 4 4 100.0
pod n/a
total 16 16 100.0


line stmt bran cond sub pod time code
1             use Moose::Role;
2 1     1   424 # ABSTRACT: a thing with an ident attribute
  1         3  
  1         7  
3              
4             #pod =head1 DESCRIPTION
5             #pod
6             #pod This is an incredibly simple role. It adds a required C<ident> attribute that
7             #pod stores a simple string, meant to identify exceptions.
8             #pod
9             #pod The string has to contain at least one character, and it can't start or end
10             #pod with whitespace.
11             #pod
12             #pod =cut
13              
14             use Moose::Util::TypeConstraints;
15 1     1   4186  
  1         2  
  1         6  
16             has ident => (
17             is => 'ro',
18             isa => subtype('Str', where { length && /\A\S/ && /\S\z/ }),
19             required => 1,
20             );
21              
22             no Moose::Role;
23 1     1   1912 use Moose::Util::TypeConstraints;
  1         2  
  1         3  
24 1     1   208 1;
  1         2  
  1         3  
25              
26              
27             =pod
28              
29             =encoding UTF-8
30              
31             =head1 NAME
32              
33             Role::Identifiable::HasIdent - a thing with an ident attribute
34              
35             =head1 VERSION
36              
37             version 0.008
38              
39             =head1 DESCRIPTION
40              
41             This is an incredibly simple role. It adds a required C<ident> attribute that
42             stores a simple string, meant to identify exceptions.
43              
44             The string has to contain at least one character, and it can't start or end
45             with whitespace.
46              
47             =head1 PERL VERSION
48              
49             This library should run on perls released even a long time ago. It should work
50             on any version of perl released in the last five years.
51              
52             Although it may work on older versions of perl, no guarantee is made that the
53             minimum required version will not be increased. The version may be increased
54             for any reason, and there is no promise that patches will be accepted to lower
55             the minimum required perl.
56              
57             =head1 AUTHOR
58              
59             Ricardo Signes <rjbs@semiotic.systems>
60              
61             =head1 COPYRIGHT AND LICENSE
62              
63             This software is copyright (c) 2022 by Ricardo Signes.
64              
65             This is free software; you can redistribute it and/or modify it under
66             the same terms as the Perl 5 programming language system itself.
67              
68             =cut