Skip to content

Commit

Permalink
Un-hard-code the event storage class.
Browse files Browse the repository at this point in the history
Not documenting it just yet, not sure I want to expose it.
  • Loading branch information
schwern committed May 25, 2012
1 parent e98b44b commit 92d3823
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions lib/TB2/History.pm
Expand Up @@ -91,12 +91,17 @@ An array ref of all events seen.
=cut

sub event_storage_class {
return "TB2::History::EventStorage";
}

has event_storage =>
is => 'ro',
isa => 'TB2::History::EventStorage',
default => sub {
$_[0]->load("TB2::History::EventStorage");
return TB2::History::EventStorage->new;
my $storage_class = $_[0]->event_storage_class;
$_[0]->load($storage_class);
return $storage_class->new;
};

sub events {
Expand Down

0 comments on commit 92d3823

Please sign in to comment.