E[attr]
[catagits/HTML-Zoom.git] / lib / HTML / Zoom / CodeStream.pm
index 144effa..1d70a58 100644 (file)
@@ -2,6 +2,7 @@ package HTML::Zoom::CodeStream;
 
 use strict;
 use warnings FATAL => 'all';
+use base qw(HTML::Zoom::StreamBase);
 
 sub from_array {
   my ($class, @array) = @_;
@@ -13,18 +14,7 @@ sub from_array {
 
 sub new {
   my ($class, $args) = @_;
-  bless({ _code => $args->{code} }, $class);
-}
-
-sub peek {
-  my ($self) = @_;
-  if (exists $self->{_peeked}) {
-    return ($self->{_peeked});
-  }
-  if (my ($peeked) = $self->next) {
-    return ($self->{_peeked} = $peeked);
-  }
-  return;
+  bless({ _code => $args->{code}, _zconfig => $args->{zconfig} }, $class);
 }
 
 sub next {