From 6bd057874f99aeb2c0d243880f3333a64d96045f Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Thu, 27 Jun 2013 18:21:59 -0400 Subject: clean up the publisher stuff some more --- lib/Reply/Plugin.pm | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'lib/Reply/Plugin.pm') diff --git a/lib/Reply/Plugin.pm b/lib/Reply/Plugin.pm index 4eca813..c0746d1 100644 --- a/lib/Reply/Plugin.pm +++ b/lib/Reply/Plugin.pm @@ -137,7 +137,22 @@ should terminate. =cut -sub new { bless {}, shift } +sub new { + my $class = shift; + my (%opts) = @_; + + die "publisher is required" unless $opts{publisher}; + + return bless { + publisher => $opts{publisher}, + }, $class; +} + +sub publish { + my $self = shift; + + $self->{publisher}->(@_); +} =for Pod::Coverage new -- cgit v1.2.3-54-g00ecf