line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package HTML::TreeBuilderX::ASP_NET::Roles::htmlElement; |
2
|
1
|
|
|
1
|
|
1814
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
44
|
|
3
|
1
|
|
|
1
|
|
6
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
29
|
|
4
|
|
|
|
|
|
|
|
5
|
1
|
|
|
1
|
|
5
|
use Moose::Role; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
9
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
Moose::init_meta( 'HTML::Element' ); |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub BUILD { |
10
|
0
|
|
|
0
|
|
|
my $self = shift; |
11
|
|
|
|
|
|
|
|
12
|
0
|
|
|
|
|
|
Class::MOP::load_class('HTML::TreeBuilderX::ASP_NET'); |
13
|
|
|
|
|
|
|
HTML::Element->meta->add_method('httpRequest', sub { |
14
|
0
|
|
|
0
|
|
|
my ( $self, $args ) = @_; |
15
|
0
|
|
0
|
|
|
|
HTML::TreeBuilderX::ASP_NET |
16
|
0
|
|
|
|
|
|
->new({ element=> $self, %{$args//{}} }) |
17
|
|
|
|
|
|
|
->httpRequest |
18
|
|
|
|
|
|
|
; |
19
|
0
|
|
|
|
|
|
}); |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
1; |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
__END__ |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
=head1 NAME |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
HTML::TreeBuilderX::ASP_NET::Roles::htmlElement -- An easy hack for HTML::Element |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
=head1 DESCRPITION |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
A simple 15 line trait for L<HTML::TreeBuilderX::ASP_NET> with a nicer more transparent API. It adds the method C<-E<gt>httpRequest> to L<HTML::Element> objects that will return an L<HTTP::Request> that represents the state of the form. It reflects all of its arguments back to the L<HTML::TreeBuilderX::ASP_NET> constructor. |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
=head1 SYNOPSIS |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
HTML::TreeBuilderX::ASP_NET->new_with_traits( traits => ['htmlElement'] ); |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
## returns a HTTP::Request for the form |
40
|
|
|
|
|
|
|
$root->look_down( '_tag' => 'a' )->httpRequest( $hashRef ); |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
=head1 SEE ALSO |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
B<FOR ALL DOCS> |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
L<HTML::TreeBuilderX::ASP_NET> |