File Coverage

blib/lib/CPAN/Index/API/Role/HavingGeneratedBy.pm
Criterion Covered Total %
statement 11 12 91.6
branch n/a
condition n/a
subroutine 4 5 80.0
pod n/a
total 15 17 88.2


line stmt bran cond sub pod time code
1             package CPAN::Index::API::Role::HavingGeneratedBy;
2             {
3             $CPAN::Index::API::Role::HavingGeneratedBy::VERSION = '0.007';
4             }
5              
6             # ABSTRACT: Provides 'generated_by' and 'last_generated' attributes
7              
8 2     2   1499 use strict;
  2         4  
  2         65  
9 2     2   8 use warnings;
  2         4  
  2         46  
10              
11 2     2   9 use Moose::Role;
  2         4  
  2         12  
12              
13             has generated_by => (
14             is => 'ro',
15             isa => 'Str',
16             required => 1,
17             lazy_build => 1,
18             );
19              
20             has last_generated => (
21             is => 'ro',
22             isa => 'Str',
23             required => 1,
24             lazy_build => 1,
25             );
26              
27             sub _build_generated_by {
28 2     2   11 my $package = blessed shift;
29 2         139 return $package . " " . $package->VERSION;
30             }
31              
32             sub _build_last_generated {
33 0     0     return scalar gmtime() . " GMT";
34             }
35              
36             1;
37              
38              
39             __END__
40             =pod
41              
42             =head1 NAME
43              
44             CPAN::Index::API::Role::HavingGeneratedBy - Provides 'generated_by' and 'last_generated' attributes
45              
46             =head1 VERSION
47              
48             version 0.007
49              
50             =head1 PROVIDES
51              
52             =head2 generated_by
53              
54             Name of software that generated the file.
55              
56             =head2 last_generated
57              
58             Date and time when the file was last generated.
59              
60             =head1 AUTHOR
61              
62             Peter Shangov <pshangov@yahoo.com>
63              
64             =head1 COPYRIGHT AND LICENSE
65              
66             This software is copyright (c) 2012 by Venda, Inc..
67              
68             This is free software; you can redistribute it and/or modify it under
69             the same terms as the Perl 5 programming language system itself.
70              
71             =cut
72