| 1 | package CPAN::Index::API::Role::HavingGeneratedBy; | ||
| 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 | |||
| 8 | 2 | ▶ | use Moose::Role; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 9 | |||
| 10 | 2 | has generated_by => ( | |
| 11 | is => 'ro', | ||
| 12 | isa => 'Str', | ||
| 13 | required => 1, | ||
| 14 | lazy_build => 1, | ||
| 15 | ); | ||
| 16 | |||
| 17 | 2 | has last_generated => ( | |
| 18 | is => 'ro', | ||
| 19 | isa => 'Str', | ||
| 20 | required => 1, | ||
| 21 | lazy_build => 1, | ||
| 22 | ); | ||
| 23 | |||
| 24 | 2 | ▶ | sub _build_generated_by { |
|
Subroutine
_build_generated_by: called CC=1 SCAR=0.0
| |||
| 25 | 2 | my $package = blessed shift; | |
| 26 | 2 | return $package . " " . $package->VERSION; | |
| 27 | } | ||
| 28 | |||
| 29 | 0 | ▶ | sub _build_last_generated { |
|
Subroutine
_build_last_generated: not called CC=1 SCAR=6.9
| |||
| 30 | 0 | return scalar gmtime() . " GMT"; | |
| 31 | } | ||
| 32 | |||
| 33 | 2 | 1; | |
| 34 | |||
| 35 | =pod | ||
| 36 | |||
| 37 | =encoding UTF-8 | ||
| 38 | |||
| 39 | =head1 NAME | ||
| 40 | |||
| 41 | CPAN::Index::Role::HavingGeneratedBy - Provides 'generated_by' and 'last_generated' attributes | ||
| 42 | |||
| 43 | =head1 PROVIDES | ||
| 44 | |||
| 45 | =head2 generated_by | ||
| 46 | |||
| 47 | Name of software that generated the file. | ||
| 48 | |||
| 49 | =head2 last_generated | ||
| 50 | |||
| 51 | Date and time when the file was last generated. | ||
| 52 | |||
| 53 | =cut | ||