package HTML::Zoom::StreamBase;
-use strict;
-use warnings FATAL => 'all';
+use strictures 1;
use HTML::Zoom::TransformBuilder;
sub _zconfig { shift->{_zconfig} }
$self->$code;
}
+sub apply_if {
+ my ($self, $predicate, $code) = @_;
+ if($predicate) {
+ local $_ = $self;
+ $self->$code;
+ }
+ else {
+ $self;
+ }
+}
+
sub to_html {
my ($self) = @_;
$self->_zconfig->producer->html_from_stream($self);
}
+sub AUTOLOAD {
+ my ($self, $selector, @args) = @_;
+ my $meth = our $AUTOLOAD;
+ $meth =~ s/.*:://;
+ return $self = $self->select($selector)->$meth(@args);
+}
+
1;