line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
##---------------------------------------------------------------------------- |
2
|
|
|
|
|
|
|
## HTML Object - ~/lib/HTML/Object/Boolean.pm |
3
|
|
|
|
|
|
|
## Version v0.2.0 |
4
|
|
|
|
|
|
|
## Copyright(c) 2021 DEGUEST Pte. Ltd. |
5
|
|
|
|
|
|
|
## Author: Jacques Deguest <jack@deguest.jp> |
6
|
|
|
|
|
|
|
## Created 2021/04/22 |
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::Boolean; |
15
|
|
|
|
|
|
|
BEGIN |
16
|
|
|
|
|
|
|
{ |
17
|
1
|
|
|
1
|
|
913
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
29
|
|
18
|
1
|
|
|
1
|
|
4
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
28
|
|
19
|
1
|
|
|
1
|
|
5
|
use parent qw( Module::Generic::Boolean ); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
5
|
|
20
|
1
|
|
|
1
|
|
110
|
use vars qw( $VERSION ); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
43
|
|
21
|
1
|
|
|
1
|
|
27
|
our $VERSION = 'v0.2.0'; |
22
|
|
|
|
|
|
|
}; |
23
|
|
|
|
|
|
|
|
24
|
1
|
|
|
1
|
|
6
|
use strict; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
17
|
|
25
|
1
|
|
|
1
|
|
4
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
243
|
|
26
|
|
|
|
|
|
|
|
27
|
0
|
|
|
0
|
1
|
|
sub getChildNodes { return( shift->new_array ); } |
28
|
|
|
|
|
|
|
|
29
|
0
|
|
|
0
|
1
|
|
sub getAttributes { return( shift->new_array ); } |
30
|
|
|
|
|
|
|
|
31
|
0
|
|
|
0
|
1
|
|
sub False { return( shift->false ); } |
32
|
|
|
|
|
|
|
|
33
|
0
|
|
|
0
|
1
|
|
sub string_value { return( shift->to_literal->value ); } |
34
|
|
|
|
|
|
|
|
35
|
0
|
|
|
0
|
1
|
|
sub to_boolean { return( $_[0] ); } |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
sub to_literal |
38
|
|
|
|
|
|
|
{ |
39
|
0
|
|
|
0
|
1
|
|
require HTML::Object::Literal; |
40
|
0
|
0
|
|
|
|
|
return( HTML::Object::Literal->new( shift->value ? 'true' : 'false' ) ); |
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
sub to_number |
44
|
|
|
|
|
|
|
{ |
45
|
0
|
|
|
0
|
1
|
|
require HTML::Object::Number; |
46
|
0
|
|
|
|
|
|
return( HTML::Object::Number->new( shift->value ) ); |
47
|
|
|
|
|
|
|
} |
48
|
|
|
|
|
|
|
|
49
|
0
|
|
|
0
|
1
|
|
sub True { return( shift->true ); } |
50
|
|
|
|
|
|
|
|
51
|
0
|
|
|
0
|
1
|
|
sub value { return( ${$_[0]} ); } |
|
0
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
1; |
54
|
|
|
|
|
|
|
# NOTE: POD |
55
|
|
|
|
|
|
|
__END__ |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
=encoding utf8 |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
=head1 NAME |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
HTML::Object::Boolean - HTML Object Boolean Class |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
=head1 SYNOPSIS |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
=head1 VERSION |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
v0.2.0 |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
=head1 DESCRIPTION |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
This module implements simple boolean true/false objects. |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
It inherits from L<Module::Generic::Boolean> |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
=head1 METHODS |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
=head2 getChildNodes |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
Returns and empty L<array object|Module::Generic::Array> |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
=head2 getAttributes |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
Returns and empty L<array object|Module::Generic::Array> |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
=head2 False |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
Creates a new Boolean object with a false value. |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
=head2 string_value |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
Returns C<true> if true, or C<false> if false |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
=head2 to_boolean |
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
Returns the current boolean object it was called on. |
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
=head2 to_literal |
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
Returns the string "true" or "false". |
100
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
=head2 to_number |
102
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
Returns a new L<HTML::Object::Number> object based on the current boolean value. |
104
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
=head2 True |
106
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
Creates a new Boolean object with a true value. |
108
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
=head2 value |
110
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
Returns true or false. |
112
|
|
|
|
|
|
|
|
113
|
|
|
|
|
|
|
=head1 AUTHOR |
114
|
|
|
|
|
|
|
|
115
|
|
|
|
|
|
|
Jacques Deguest E<lt>F<jack@deguest.jp>E<gt> |
116
|
|
|
|
|
|
|
|
117
|
|
|
|
|
|
|
=head1 SEE ALSO |
118
|
|
|
|
|
|
|
|
119
|
|
|
|
|
|
|
L<HTML::Object>, L<HTML::Object::Attribute>, L<HTML::Object::Boolean>, L<HTML::Object::Closing>, L<HTML::Object::Collection>, L<HTML::Object::Comment>, L<HTML::Object::Declaration>, L<HTML::Object::Document>, L<HTML::Object::Element>, L<HTML::Object::Exception>, L<HTML::Object::Literal>, L<HTML::Object::Number>, L<HTML::Object::Root>, L<HTML::Object::Space>, L<HTML::Object::Text>, L<HTML::Object::XQuery> |
120
|
|
|
|
|
|
|
|
121
|
|
|
|
|
|
|
=head1 COPYRIGHT & LICENSE |
122
|
|
|
|
|
|
|
|
123
|
|
|
|
|
|
|
Copyright (c) 2021 DEGUEST Pte. Ltd. |
124
|
|
|
|
|
|
|
|
125
|
|
|
|
|
|
|
All rights reserved |
126
|
|
|
|
|
|
|
|
127
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. |
128
|
|
|
|
|
|
|
|
129
|
|
|
|
|
|
|
=cut |