aboutsummaryrefslogtreecommitdiff
path: root/lib/App/Beam/History/Entry.pm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/App/Beam/History/Entry.pm')
-rw-r--r--lib/App/Beam/History/Entry.pm10
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/App/Beam/History/Entry.pm b/lib/App/Beam/History/Entry.pm
index 8443f3f..e5a8c7e 100644
--- a/lib/App/Beam/History/Entry.pm
+++ b/lib/App/Beam/History/Entry.pm
@@ -5,7 +5,7 @@ use Carp;
require Exporter;
our @ISA = qw(Exporter);
-our @EXPORT_OK = qw(STATE_PENDING STATE_SUCCESS STATE_FAILURE);
+our @EXPORT_OK = qw(STATE_PENDING STATE_SUCCESS STATE_FAILURE state_string);
our %EXPORT_TAGS = (
state => [ qw(STATE_PENDING STATE_SUCCESS STATE_FAILURE) ]
);
@@ -40,9 +40,15 @@ sub state {
return $self->{state};
}
+sub state_string {
+ my ($state) = @_;
+ return $state unless $state <= $#state_str;
+ return $state_str[$state];
+}
+
sub state_name {
my ($self) = @_;
- return $state_str[$self->state];
+ return state_string($self->state);
}
sub start_time {

Return to:

Send suggestions and report system problems to the System administrator.