|
|
@ -14,24 +14,7 @@ our $VERSION = 0.1; |
|
|
|
sub new { |
|
|
|
sub new { |
|
|
|
my ($class) = @_; |
|
|
|
my ($class) = @_; |
|
|
|
|
|
|
|
|
|
|
|
return bless({ items => [], version => 0 }, $class); |
|
|
|
return bless({ 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; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
sub parse { |
|
|
|
sub parse { |
|
|
|