package HTML::Zoom::Producer::BuiltIn;
-use strict;
-use warnings FATAL => 'all';
+use strictures 1;
+use base qw(HTML::Zoom::SubObject);
sub html_from_stream {
- my ($class, $stream) = @_;
- my $html;
- while (my ($evt) = $stream->next) { $html .= $class->_event_to_html($evt) }
- return $html;
+ my ($self, $stream) = @_;
+ return
+ join '',
+ map $self->event_to_html($_),
+ $self->_zconfig->stream_utils->stream_to_array($stream)
}
-sub _event_to_html {
+sub html_from_events {
+ my ($self, $events) = @_;
+ join '', map $self->event_to_html($_), @$events;
+}
+
+sub event_to_html {
my ($self, $evt) = @_;
# big expression
if (defined $evt->{raw}) {