annotate Lib/IMPL/Web/TT/Collection.pm @ 107:0e72ad99eef7

Updated Web::TT
author wizard
date Thu, 13 May 2010 03:46:29 +0400
parents
children ddf0f037d460
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
107
0e72ad99eef7 Updated Web::TT
wizard
parents:
diff changeset
1 package IMPL::Web::TT::Collection;
0e72ad99eef7 Updated Web::TT
wizard
parents:
diff changeset
2 use strict;
0e72ad99eef7 Updated Web::TT
wizard
parents:
diff changeset
3
0e72ad99eef7 Updated Web::TT
wizard
parents:
diff changeset
4 use base qw(IMPL::DOM::Node);
0e72ad99eef7 Updated Web::TT
wizard
parents:
diff changeset
5
0e72ad99eef7 Updated Web::TT
wizard
parents:
diff changeset
6 __PACKAGE__->PassThroughArgs;
0e72ad99eef7 Updated Web::TT
wizard
parents:
diff changeset
7
0e72ad99eef7 Updated Web::TT
wizard
parents:
diff changeset
8 our $AUTOLOAD;
0e72ad99eef7 Updated Web::TT
wizard
parents:
diff changeset
9 sub AUTOLOAD {
0e72ad99eef7 Updated Web::TT
wizard
parents:
diff changeset
10 my $this = shift;
0e72ad99eef7 Updated Web::TT
wizard
parents:
diff changeset
11 my ($method) = ($AUTOLOAD =~ /(\w+)$/);
0e72ad99eef7 Updated Web::TT
wizard
parents:
diff changeset
12
0e72ad99eef7 Updated Web::TT
wizard
parents:
diff changeset
13 my @result = $this->selectNodes($method);
0e72ad99eef7 Updated Web::TT
wizard
parents:
diff changeset
14
0e72ad99eef7 Updated Web::TT
wizard
parents:
diff changeset
15 return $result[0] if @result;
0e72ad99eef7 Updated Web::TT
wizard
parents:
diff changeset
16 return;
0e72ad99eef7 Updated Web::TT
wizard
parents:
diff changeset
17 }
0e72ad99eef7 Updated Web::TT
wizard
parents:
diff changeset
18
0e72ad99eef7 Updated Web::TT
wizard
parents:
diff changeset
19 sub as_list {
0e72ad99eef7 Updated Web::TT
wizard
parents:
diff changeset
20 $_[0]->childNodes;
0e72ad99eef7 Updated Web::TT
wizard
parents:
diff changeset
21 }
0e72ad99eef7 Updated Web::TT
wizard
parents:
diff changeset
22
0e72ad99eef7 Updated Web::TT
wizard
parents:
diff changeset
23 1;