Articulate/Enrichment/DateUpdated.pm

filter: Statementstmt 100% 23 / 23 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 7 / 7 Podpod 50.0% 1 / 2 totaltotal 96.8% 31 / 32 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« Articulate/Sortation/String.pm ↑ Summary Articulate/Authorisation/AlwaysAllow.pm »
1 package Articulate::Enrichment::DateUpdated;
2 5 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 5 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 5 ▶use Text::Markdown;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 5 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 =head1 NAME
9  
10 Articulate::Enrichment::DateUpdated - add a update date to the meta
11  
12 =head1 METHODS
13  
14 =head3 enrich
15  
16 Sets the update date (C<meta.schema.core.dateUpdated>) to the current time.
17  
18 =cut
19  
20 5 ▶use DateTime;
Subroutine BEGIN: called CC=1 SCAR=0.0
21  
22 sub now {
23 2 ▶ DateTime->now;
Subroutine now: called CC=1 SCAR=0.0
Pod undocumented
24 }
25  
26 sub enrich {
27 2 ▶ my $self = shift;
Subroutine enrich: called CC=1 SCAR=0.0
Pod documented
28 2 my $item = shift;
29 2 my $request = shift;
30 2 my $now = now;
31 2 $item->meta->{schema}->{core}->{dateUpdated} = "$now";
32 2 return $item;
33 }
34  
35 5 1;
« Articulate/Sortation/String.pm ↑ Summary Articulate/Authorisation/AlwaysAllow.pm »