From: Matt S Trout Date: Mon, 24 May 2010 20:22:57 +0000 (+0100) Subject: fix as_stream typo to to_stream X-Git-Tag: release_0.009004~66 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FHTML-Zoom.git;a=commitdiff_plain;h=c9e76777a78b49d1713c9d20591847a9855364b5 fix as_stream typo to to_stream --- diff --git a/lib/HTML/Zoom.pm b/lib/HTML/Zoom.pm index dac8bd7..7aef7e7 100644 --- a/lib/HTML/Zoom.pm +++ b/lib/HTML/Zoom.pm @@ -344,7 +344,7 @@ HTML::Zoom does its best to defer doing anything until it's absolutely required. The only point at which it descends into state is when you force it to create a stream, directly by: - my $stream = $zoom->as_stream; + my $stream = $zoom->to_stream; while (my $evt = $stream->next) { # handle zoom event here diff --git a/lib/HTML/Zoom/StreamUtils.pm b/lib/HTML/Zoom/StreamUtils.pm index 16a029f..6c571fc 100644 --- a/lib/HTML/Zoom/StreamUtils.pm +++ b/lib/HTML/Zoom/StreamUtils.pm @@ -41,11 +41,11 @@ sub stream_from_proto { } elsif ($ref eq 'ARRAY') { return $self->stream_from_array(@$proto); } elsif ($ref eq 'CODE') { - return $proto->(); + return $self->stream_from_code($proto); } elsif ($ref eq 'SCALAR') { return $self->_zconfig->parser->html_to_stream($$proto); - } elsif (Scalar::Util::blessed($proto) && $proto->can('as_stream')) { - my $stream = $proto->as_stream; + } elsif (Scalar::Util::blessed($proto) && $proto->can('to_stream')) { + my $stream = $proto->to_stream; return $self->stream_from_code(sub { $stream->next }); } die "Don't know how to turn $proto (ref $ref) into a stream";