Mercurial > pub > Impl
comparison Lib/IMPL/Web/TT/Collection.pm @ 150:4369d5458bb6
minor fixes
author | wizard |
---|---|
date | Fri, 20 Aug 2010 08:28:43 +0400 |
parents | ddf0f037d460 |
children | eb478083f72b |
comparison
equal
deleted
inserted
replaced
149:b04e978d6d5a | 150:4369d5458bb6 |
---|---|
10 my $this = shift; | 10 my $this = shift; |
11 my ($method) = ($AUTOLOAD =~ /(\w+)$/); | 11 my ($method) = ($AUTOLOAD =~ /(\w+)$/); |
12 | 12 |
13 return if $method eq 'DESTROY'; | 13 return if $method eq 'DESTROY'; |
14 | 14 |
15 if ($method =~ /^add(\w+)/) { | |
16 my ($name,$args) = @_; | |
17 return $this->appendChild($this->document->CreateControl($name,$1,$args)); | |
18 } | |
19 | |
20 if ( @_ >= 1 ) { | 15 if ( @_ >= 1 ) { |
21 # set | 16 # set |
17 | |
18 if ($method =~ /^add(\w+)/) { | |
19 my ($name,$args) = @_; | |
20 return $this->appendChild($this->document->CreateControl($name,$1,$args)); | |
21 } | |
22 | |
22 # we can't assing a node, so this is a dynamic property | 23 # we can't assing a node, so this is a dynamic property |
23 return $this->nodeProperty($method,@_); | 24 return $this->nodeProperty($method,@_); |
24 } else { | 25 } else { |
25 # get | 26 # get |
26 # try a dynamic property first | 27 # try a dynamic property first |
29 } else { | 30 } else { |
30 # and return a first child node as last opportunity | 31 # and return a first child node as last opportunity |
31 my @result = $this->selectNodes($method); | 32 my @result = $this->selectNodes($method); |
32 | 33 |
33 return $result[0] if @result; | 34 return $result[0] if @result; |
34 return; | |
35 } | 35 } |
36 } | 36 } |
37 die new IMPL::Exception("We shoud never get here, this is a bug!!!"); | 37 |
38 return; | |
38 } | 39 } |
39 | 40 |
40 sub as_list { | 41 sub as_list { |
41 $_[0]->childNodes; | 42 $_[0]->childNodes; |
42 } | 43 } |