$self->select($self->{transforms}->[-1]->selector);
}
+## mst: well I'm thinking if basically
+## mst: $zoom->$whatever($selector => @args)
+## mst: becomes $zoom->select($selector)->$whatever(@args)
+
+sub AUTOLOAD {
+ my $self = shift;
+ my %selection_args = @_;
+ my $meth = our $AUTOLOAD;
+ $meth =~ s/.*:://;
+ while( my($selector, $args) = each %selection_args) {
+ $self = $self->select($selector)->$meth($args);
+ }
+ return $self
+}
1;
=head1 NAME
--- /dev/null
+use strict;
+use warnings FATAL => 'all';
+
+use HTML::Zoom;
+use Test::More;
+
+ok my $zoom = HTML::Zoom->from_html(<<HTML);
+<html>
+ <head>
+ <title>Hi!</title>
+ </head>
+ <body id="content-area">
+ <h1>Test</h1>
+ <div>
+ <p class="first-para">Some Stuff</p>
+ <p class="body-para">More Stuff</p>
+ <p class="body-para">Even More Stuff</p>
+ <ol>
+ <li class="first-item odd">First</li>
+ <li class="body-items even">Stuff A</li>
+ <li class="body-items odd">Stuff B</li>
+ <li class="body-items even">Stuff C</li>
+ <li class="last-item odd">Last</li>
+ </ol>
+ <p class="body-para">Even More stuff</p>
+ <p class="last-para">Some Stuff</p>
+ </div>
+ <p id="footer">Copyright 2222</p>
+ </body>
+</html>
+HTML
+
+## mst: well I'm thinking if basically
+## mst: $zoom->$whatever($selector => @args)
+## mst: becomes $zoom->select($selector)->$whatever(@args)
+
+ok ! eval { $zoom->ressplace_content('.first-param' => 'First!'); 1},
+ 'Properly die on bad method';
+
+ok my $html = $zoom
+ ->replace_content('.first-para' => 'First!')
+ ->replace_content('.last-para' => 'Last!')
+ ->prepend_content(
+ '.first-item' => [{type=>'TEXT', raw=>'FIRST: '}],
+ '.last-item' => [{type=>'TEXT', raw=>'LAST: '}],
+ )
+ ->to_html;
+
+warn $html;
+
+#warn $zoom->select('.last-item')->prepend_content([{type=>'TEXT', raw=>'ddd'}])->to_html;
+#warn $zoom->select('.last-item')->prepend_content(\'ddd')->to_html;
+
+done_testing;