lib/HTML/Object/ErrorEvent.pm

filter: Statementstmt 75.0% 21 / 28 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 77.7% 7 / 9 Podpod 100% 2 / 2 totaltotal 73.1% 30 / 41 CC 2 SCAR 7.4
CC
2
Cov
70%
init
6.0
signal
2.0
BEGIN
1.0
CRAP 2.1
« lib/HTML/Object/Root.pm ↑ Summary lib/HTML/Object/DOM/Element/Quote.pm »
1 ##----------------------------------------------------------------------------
2 ## HTML Object - ~/lib/HTML/Object/ErrorEvent.pm
3 ## Version v0.2.0
4 ## Copyright(c) 2021 DEGUEST Pte. Ltd.
5 ## Author: Jacques Deguest <jack@deguest.jp>
6 ## Created 2021/12/17
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::ErrorEvent;
15 BEGIN
16 {
17 32 ▶ use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
18 32 ▶ use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
19 32 ▶ warnings::register_categories( 'HTML::Object' );
Subroutine BEGIN: called CC=1 SCAR=0.0
20 32 ▶ use parent qw( HTML::Object::Exception );
Subroutine BEGIN: called CC=1 SCAR=0.0
21 32 ▶ use vars qw( $VERSION );
Subroutine BEGIN: called CC=1 SCAR=0.0
22 32 our $VERSION = 'v0.2.0';
23 };
24  
25 32 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
26 32 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
27  
28 sub init
29 {
30 0 ▶ my $self = shift( @_ );
Subroutine init: not called CC=2 SCAR=17.9
Pod documented
31 0 my $sig = shift( @_ );
32 0 $self->{_init_strict_use_sub} = 1;
33 0 ▶ $self->SUPER::init( @_ ) || return( $self->pass_error );
Branch: 1 branch
BranchTrueFalseTotal
$self->SUPER::init(@_) or return $self->pass_error 0 0 0
34 0 $self->{signal} = $sig;
35 0 return( $self );
36 }
37  
38 0 ▶sub signal { return( shift->_set_get_scalar( 'signal', @_ ) ); }
Subroutine signal: not called CC=1 SCAR=6.9
Pod documented
39  
40 32 1;
41 # NOTE: POD
42 __END__
43  
44 =encoding utf-8
45  
46 =head1 NAME
47  
48 HTML::Object::ErrorEvent - HTML Object Error Event Class
49  
50 =head1 SYNOPSIS
51  
52 use HTML::Object::ErrorEvent;
53 my $event = HTML::Object::ErrorEvent->new( 'WARN' ) ||
54 die( HTML::Object::ErrorEvent->error, "\n" );
55  
56 =head1 VERSION
57  
58 v0.2.0
59  
60 =head1 DESCRIPTION
61  
62 The L<HTML::Object::ErrorEvent> object represents an error triggered and captured by a global error in the L<HTML::Object::DOM::Document> object.
63  
64 It is used by properties like L<HTML::Object::DOM::Document/onabort> or L<HTML::Object::DOM::Document/onerror>
65  
66 It inherits its methods from L<HTML::Object::Exception> and implements the additional following ones:
67  
68 =head1 INHERITANCE
69  
70 +-------------------------+ +--------------------------+
71 | HTML::Object::Exception | --> | HTML::Object::ErrorEvent |
72 +-------------------------+ +--------------------------+
73  
74 =head1 CONSTRUCTOR
75  
76 =head2 new
77  
78 This takes a signal, which is case-insensitive and is saved in uppercase, and a list of strings that compose the error message, if any (e.g. for C<WARN> or C<DIE>)
79  
80 =head1 METHODS
81  
82 =head2 signal
83  
84 The signal that triggered this event object. For example: C<DIE>, C<WARN>, C<ABRT>, C<INT>, C<TERM>
85  
86 =head1 AUTHOR
87  
88 Jacques Deguest E<lt>F<jack@deguest.jp>E<gt>
89  
90 =head1 SEE ALSO
91  
92 L<HTML::Object::Exception>, L<HTML::Object::DOM::Document>
93  
94 See L<for more information|https://developer.mozilla.org/en-US/docs/Web/API/ErrorEvent>
95  
96 =head1 COPYRIGHT & LICENSE
97  
98 Copyright(c) 2021 DEGUEST Pte. Ltd.
99  
100 All rights reserved
101  
102 This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
103  
104 =cut
« lib/HTML/Object/Root.pm ↑ Summary lib/HTML/Object/DOM/Element/Quote.pm »