From: Matt S Trout Date: Fri, 5 Feb 2010 21:00:57 +0000 (+0000) Subject: make collect API take a hashref for options X-Git-Tag: release_0.009004~92 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FHTML-Zoom.git;a=commitdiff_plain;h=c7327c2cabe34b1d96966d300aa6238259d8fdc0 make collect API take a hashref for options --- diff --git a/lib/HTML/Zoom/FilterBuilder.pm b/lib/HTML/Zoom/FilterBuilder.pm index 4a2bebb..9645143 100644 --- a/lib/HTML/Zoom/FilterBuilder.pm +++ b/lib/HTML/Zoom/FilterBuilder.pm @@ -90,7 +90,7 @@ sub add_after { sub { my ($evt, $stream) = @_; my $emit = $self->_stream_from_array(@$events); - my $coll = $self->collect(undef, 1)->(@_); + my $coll = $self->collect(undef, { passthrough => 1 })->(@_); return ref($coll) eq 'HASH' # single event, no collect ? [ $coll, $emit ] : [ $coll->[0], $self->_stream_concat($coll->[1], $emit) ]; @@ -122,7 +122,8 @@ sub replace { } sub collect { - my ($self, $into, $passthrough) = @_; + my ($self, $into, $attrs) = @_; + my ($passthrough) = @{$attrs}{qw(passthrough)}; sub { my ($evt, $stream) = @_; push(@$into, $evt) if $into;