diff options
author | Shawn M Moore <code@sartak.org> | 2013-06-27 13:32:14 -0400 |
---|---|---|
committer | Shawn M Moore <code@sartak.org> | 2013-06-27 13:32:14 -0400 |
commit | 791b89f2b3d2ebdab4311ba2a60caf1be96d3466 (patch) | |
tree | 087a73b8c782d3200331339396935b663bc7d681 /lib | |
parent | 65e7bc36b13ed84a553a78c5855fad6e3319d8c3 (diff) | |
download | reply-791b89f2b3d2ebdab4311ba2a60caf1be96d3466.tar.gz reply-791b89f2b3d2ebdab4311ba2a60caf1be96d3466.zip |
_concatenate_plugin for returning all plugins' return values in a list
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Reply.pm | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/Reply.pm b/lib/Reply.pm index bb72149..d5a3d4d 100644 --- a/lib/Reply.pm +++ b/lib/Reply.pm @@ -283,6 +283,22 @@ sub _chained_plugin { return @args; } +sub _concatenate_plugin { + my $self = shift; + my @plugins = ref($_[0]) ? @{ shift() } : $self->_plugins; + my ($method, @args) = @_; + + @plugins = grep { $_->can($method) } @plugins; + + my @results; + + for my $plugin (@plugins) { + push @results, $plugin->$method(@args); + } + + return @results; +} + =head1 BUGS No known bugs. |