API/Role/HavingFilename.pm

filter: Statementstmt 100% 18 / 18 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 5 / 5 Podpod n/a totaltotal 100% 23 / 23 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« API/Role/HavingGeneratedBy.pm ↑ Summary
1 package CPAN::Index::API::Role::HavingFilename;
2  
3 2 our $VERSION = '0.008';
4  
5 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 2 ▶use Path::Class ();
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 2 ▶use Moose::Role;
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 2 requires 'default_location';
12  
13 2 has filename => (
14 is => 'ro',
15 isa => 'Str',
16 required => 1,
17 lazy_build => 1,
18 );
19  
20 9 ▶sub _build_filename {
Subroutine _build_filename: called CC=1 SCAR=0.0
21 9 my $self = shift;
22 9 return Path::Class::file($self->default_location)->basename;
23 }
24  
25 2 1;
26  
27 =pod
28  
29 =encoding UTF-8
30  
31 =head1 NAME
32  
33 CPAN::Index::Role::HavingFilename - Provides 'filename' attribute
34  
35 =head1 REQUIRES
36  
37 =head2 deafult_location
38  
39 Class method that returns a string specifying the path to the default location
40 of this file relative to the repository root.
41  
42 =head1 PROVIDES
43  
44 =head2 filename
45  
46 Name of the current file - defaults to the basename of the path specified
47 in C<default_location>;
48  
49 =cut
« API/Role/HavingGeneratedBy.pm ↑ Summary