blib/lib/HTML/Object/DOM/Element/Anchor.pm untested

filter: Statementstmt 0.0% 0 / 41 Branchbran 0.0% 0 / 4 Conditioncond 0.0% 0 / 2 MC/DCmcdc n/a Subroutinesub 0.0% 0 / 13 Podpod 0.0% 0 / 5 totaltotal 0.0% 0 / 65 CC 3 SCAR 13.9
CC
3
Cov
0%
init
12.0
BEGIN
2.0
text
2.0
CRAP 4.0
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 {
17 use strict;
18 use warnings;
19 warnings::register_categories( 'HTML::Object' );
20 use parent qw( HTML::Object::DOM::Element );
21 use vars qw( $VERSION );
22 use HTML::Object;
23 use HTML::Object::DOM::Element::Shared qw( :anchor );
24 our $VERSION = 'v0.2.0';
25 };
26  
27 use strict;
28 use warnings;
29  
30 sub init
31 {
32 my $self = shift( @_ );
33 $self->{_init_strict_use_sub} = 1;
34 $self->SUPER::init( @_ ) || return( $self->pass_error );
35 $self->{tag} = 'a' if( !$self->tag );
36 $self->{uri} = '';
37 $self->_set_get_internal_attribute_callback( rel => sub
38 {
39 my( $this, $val ) = @_;
40 my $list;
41 return if( !( $list = $this->{_rel_list} ) );
42 # $list->debug( $self->debug );
43 $list->update( $val );
44 });
45 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 sub text : lvalue { return( shift->textContent( @_ ) ); }
85  
86 sub toString { return( shift->attr( 'href' ) ); }
87  
88 # Note: property
89 sub type : lvalue { return( shift->_set_get_property( 'type', @_ ) ); }
90  
91 # Note: property username inherited
92  
93 1;
94 # NOTE: POD
95 __END__