Object/DOM/Element/Anchor.pm

filter: Statementstmt 100% 41 / 41 Branchbran 83.3% 5 / 6 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 14 / 14 Podpod 100% 4 / 4 totaltotal 98.4% 64 / 65 CC 4 SCAR 3.9
CC
4
Cov
98%
init
3.0
__ANON__
2.0
BEGIN
1.0
CRAP 1.5
« Object/Exception.pm ↑ Summary Object/Text.pm »
1 ##----------------------------------------------------------------------------
2 ## HTML Object - ~/lib/HTML/Object/DOM/Element/Anchor.pm
3 ## Version v0.2.0
4 ## Copyright(c) 2021 DEGUEST Pte. Ltd.
5 ## Author: Jacques Deguest <jack@deguest.jp>
6 ## Created 2021/12/21
7 ## Modified 2022/09/18
8 ## All rights reserved.
9 ##
10 ##
11 ## This program is free software; you can redistribute it and/or modify it
12 ## under the same terms as Perl itself.
13 ##----------------------------------------------------------------------------
14 package HTML::Object::DOM::Element::Anchor;
15 BEGIN
16 8 ▶{
Subroutine BEGIN: called CC=1 SCAR=0.0
17 8 ▶ use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
18 8 ▶ use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
19 8 warnings::register_categories( 'HTML::Object' );
20 8 ▶ use parent qw( HTML::Object::DOM::Element );
Subroutine BEGIN: called CC=1 SCAR=0.0
21 8 ▶ use vars qw( $VERSION );
Subroutine BEGIN: called CC=1 SCAR=0.0
22 8 ▶ use HTML::Object;
Subroutine BEGIN: called CC=1 SCAR=0.0
23 8 ▶ use HTML::Object::DOM::Element::Shared qw( :anchor );
Subroutine BEGIN: called CC=1 SCAR=0.0
24 8 our $VERSION = 'v0.2.0';
25 };
26  
27 8 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
28 8 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
29  
30 sub init
31 7 ▶{
Subroutine init: called CC=3 SCAR=11.0
Pod documented
32 7 my $self = shift( @_ );
33 7 $self->{_init_strict_use_sub} = 1;
34 7 ▶ $self->SUPER::init( @_ ) || return( $self->pass_error );
Branch: 1 branch
BranchTrueFalseTotal
$self->SUPER::init(@_) or return $self->pass_error 7 0 7
35 7 ▶ $self->{tag} = 'a' if( !$self->tag );
Branch: 1 branch
BranchTrueFalseTotal
unless $self->tag 1 6 7
36 7 $self->{uri} = '';
37 $self->_set_get_internal_attribute_callback( rel => sub
38 3 ▶ {
Subroutine __ANON__: called CC=2 SCAR=6.9
39 3 my( $this, $val ) = @_;
40 3 my $list;
41 3 ▶ return if( !( $list = $this->{_rel_list} ) );
Branch: 1 branch
BranchTrueFalseTotal
unless $list = $this->{"_rel_list"} 1 2 3
42 # $list->debug( $self->debug );
43 2 $list->update( $val );
44 7 });
45 7 return( $self );
46 }
47  
48 # Note: property download inherited
49  
50 # Note: property hash inherited
51  
52 # Note: property host inherited
53  
54 # Note: property hostname inherited
55  
56 # Note: property href inherited
57  
58 # Note: property hreflang inherited
59  
60 # Note: read-only property origin inherited
61  
62 # Note: property password inherited
63  
64 # Note: property pathname inherited
65  
66 # Note: property port inherited
67  
68 # Note: property protocol inherited
69  
70 # Note: property referrerPolicy inherited
71  
72 # Note: property rel inherited
73  
74 # Note: property read-only relList inherited. Similar to HTML::Object::DOM::Element->classList
75  
76 # Note: property search inherited
77  
78 # Note: tabIndex is inherited from HTML::Object::DOM::Element
79  
80 # Note: property target inherited
81  
82 # Note: alias for textContent in HTML::Object::DOM::Node
83 # Note: property
84 2 ▶sub text : lvalue { return( shift->textContent( @_ ) ); }
Subroutine text: called CC=1 SCAR=0.0
Pod documented
85  
86 1 ▶sub toString { return( shift->attr( 'href' ) ); }
Subroutine toString: called CC=1 SCAR=0.0
Pod documented
87  
88 # Note: property
89 2 ▶sub type : lvalue { return( shift->_set_get_property( 'type', @_ ) ); }
Subroutine type: called CC=1 SCAR=0.0
Pod documented
90  
91 # Note: property username inherited
92  
93 8 1;
94 # NOTE: POD
95 __END__
« Object/Exception.pm ↑ Summary Object/Text.pm »