Skip to content

Commit a5ca554

Browse files
authored
Merge pull request #60 from nyarla/add-updated-method-to-entry
chore(Kalaclista::Data::Entry): add `updated` method to Kalaclista::Data::Entry
2 parents aeccf46 + e5051e9 commit a5ca554

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

lib/Kalaclista/Data/Entry.pm

+2
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ class Kalaclista::Data::Entry {
3030
method dom { $dom }
3131
method meta { $meta }
3232

33+
method updated { $self->lastmod // $self->date }
34+
3335
method clone {
3436
my $class = ref($self);
3537
my %overrides = @_;

t/Kalaclista-Data-Entry/10_common.t

+1
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ subtest common => sub {
3131
is $entry->draft, false;
3232
is $entry->date, '2024-01-01T00:00:00';
3333
is $entry->lastmod, '2024-02-01T00:00:00';
34+
is $entry->updated, '2024-02-01T00:00:00';
3435
is $entry->href->to_string, 'https://example.com/entry';
3536
is $entry->dom, undef;
3637
is $entry->src, '';

0 commit comments

Comments
 (0)