|
|
|
@ -14,24 +14,7 @@ our $VERSION = 0.1;
|
|
|
|
|
sub new { |
|
|
|
|
my ($class) = @_; |
|
|
|
|
|
|
|
|
|
return bless({ items => [], version => 0 }, $class); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
sub add { |
|
|
|
|
my ($self, %args) = @_; |
|
|
|
|
|
|
|
|
|
foreach my $key (qw(title location)) { |
|
|
|
|
next if $args{$key}; |
|
|
|
|
return "Missing '$key' parameter"; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
$self->{items} //= []; |
|
|
|
|
push @{$self->{items}}, { |
|
|
|
|
title => $args{title}, |
|
|
|
|
location => $args{location}, |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
return; |
|
|
|
|
return bless({ version => 0 }, $class); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
sub parse { |
|
|
|
|