aboutsummaryrefslogtreecommitdiff
path: root/lib/App/Beam/History/Item.pm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/App/Beam/History/Item.pm')
-rw-r--r--lib/App/Beam/History/Item.pm36
1 files changed, 36 insertions, 0 deletions
diff --git a/lib/App/Beam/History/Item.pm b/lib/App/Beam/History/Item.pm
new file mode 100644
index 0000000..3a30f61
--- /dev/null
+++ b/lib/App/Beam/History/Item.pm
@@ -0,0 +1,36 @@
+package App::Beam::History::Item;
+
+require App::Beam::History::Entry;
+our @ISA = qw(App::Beam::History::Entry);
+
+use strict;
+use Carp;
+
+sub new {
+ my $class = shift;
+ my $self = $class->SUPER::new;
+ $self->{files} = [];
+ return $self;
+}
+
+sub add {
+ my $self = shift;
+ push @{$self->{files}}, @_;
+}
+
+sub del {
+ my $self = shift;
+ my %h;
+ @h{@_} = 1 x @_;
+ @{$self->{files}} = grep { ! exists $h{$_} } @{$self->{files}};
+}
+
+sub files {
+ my $self = shift;
+ return @{$self->{files}};
+}
+
+sub is_empty {
+ my $self = shift;
+ return $#{$self->{files}} == -1;
+}

Return to:

Send suggestions and report system problems to the System administrator.