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