| 1 | package WWW::Mechanize::Link; | ||||||||||
| 2 | |||||||||||
| 3 | 17 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 17 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | |||||||||||
| 6 | 17 | our $VERSION = '2.21'; | |||||||||
| 7 | |||||||||||
| 8 | #ABSTRACT: Link object for WWW::Mechanize | ||||||||||
| 9 | |||||||||||
| 10 | |||||||||||
| 11 | sub new { | ||||||||||
| 12 | 220 | ▶ | my $class = shift; | ||||||||
|
Subroutine
new: called CC=2 SCAR=6.9
Pod
documented
| |||||||||||
| 13 | |||||||||||
| 14 | 220 | my $self; | |||||||||
| 15 | |||||||||||
| 16 | # The order of the first four must stay as they are for | ||||||||||
| 17 | # compatibility with older code. | ||||||||||
| 18 | 220 | ▶ | if ( ref $_[0] eq 'HASH' ) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 19 | 218 | $self = [ @{ $_[0] }{qw( url text name tag base attrs )} ]; | |||||||||
| 20 | } | ||||||||||
| 21 | else { | ||||||||||
| 22 | 2 | $self = [@_]; | |||||||||
| 23 | } | ||||||||||
| 24 | |||||||||||
| 25 | 220 | return bless $self, $class; | |||||||||
| 26 | } | ||||||||||
| 27 | |||||||||||
| 28 | |||||||||||
| 29 | 338 | ▶ | sub url { return ( $_[0] )->[0]; } | ||||||||
|
Subroutine
url: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||
| 30 | 420 | ▶ | sub text { return ( $_[0] )->[1]; } | ||||||||
|
Subroutine
text: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||
| 31 | 34 | ▶ | sub name { return ( $_[0] )->[2]; } | ||||||||
|
Subroutine
name: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||
| 32 | 48 | ▶ | sub tag { return ( $_[0] )->[3]; } | ||||||||
|
Subroutine
tag: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||
| 33 | 57 | ▶ | sub base { return ( $_[0] )->[4]; } | ||||||||
|
Subroutine
base: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||
| 34 | 28 | ▶ | sub attrs { return ( $_[0] )->[5]; } | ||||||||
|
Subroutine
attrs: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||
| 35 | |||||||||||
| 36 | |||||||||||
| 37 | sub URI { | ||||||||||
| 38 | 55 | ▶ | my $self = shift; | ||||||||
|
Subroutine
URI: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||
| 39 | |||||||||||
| 40 | 55 | require URI::URL; | |||||||||
| 41 | 55 | my $URI = URI::URL->new( $self->url, $self->base ); | |||||||||
| 42 | |||||||||||
| 43 | 55 | return $URI; | |||||||||
| 44 | } | ||||||||||
| 45 | |||||||||||
| 46 | |||||||||||
| 47 | sub url_abs { | ||||||||||
| 48 | 53 | ▶ | my $self = shift; | ||||||||
|
Subroutine
url_abs: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||
| 49 | |||||||||||
| 50 | 53 | return $self->URI->abs; | |||||||||
| 51 | } | ||||||||||
| 52 | |||||||||||
| 53 | |||||||||||
| 54 | 17 | 1; | |||||||||
| 55 | |||||||||||
| 56 | __END__ | ||||||||||