blib/lib/WWW/Wookie/Widget/Property.pm

filter: Statementstmt 94.8% 37 / 39 Branchbran 66.6% 4 / 6 Conditioncond 44.4% 4 / 9 MC/DCmcdc 16.6% 1 / 6 Subroutinesub 100% 9 / 9 Podpod n/a totaltotal 79.7% 55 / 69 SCAR 19.8
CC
7
Cov
83%
__ANON__
9.6
BEGIN
1.0
BEGIN
1.0
CRAP 7.2
« Build ↑ Summary blib/lib/WWW/Wookie/Server/Connection.pm »
1 # -*- cperl; cperl-indent-level: 4 -*-
2 # Copyright (C) 2010-2021, Roland van Ipenburg
3 package WWW::Wookie::Widget::Property v1.1.3;
4 4 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 4 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 4 ▶use utf8;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 4 ▶use 5.020000;
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 4 ▶use Moose qw/around has/;
Subroutine BEGIN: called CC=1 SCAR=0.0
11 4 ▶use namespace::autoclean '-except' => 'meta', '-also' => qr/^_/sxm;
Subroutine BEGIN: called CC=1 SCAR=0.0
12  
13 4 ▶use Readonly;
Subroutine BEGIN: called CC=1 SCAR=0.0
14 ## no critic qw(ProhibitCallsToUnexportedSubs)
15 4 Readonly::Scalar my $MORE_ARGS => 3;
16 ## use critic
17  
18 4 has '_name' => (
19 'is' => 'rw',
20 'isa' => 'Str',
21 'reader' => 'getName',
22 'writer' => 'setName',
23 );
24  
25 4 has '_value' => (
26 'is' => 'rw',
27 'isa' => 'Any',
28 'reader' => 'getValue',
29 'writer' => 'setValue',
30 );
31  
32 4 has '_public' => (
33 'is' => 'rw',
34 'isa' => 'Bool',
35 'reader' => 'getIsPublic',
36 'writer' => 'setIsPublic',
37 );
38  
39 around 'BUILDARGS' => sub {
40 7 ▶ my $orig = shift;
Subroutine __ANON__: called CC=7 SCAR=22.6
41 7 my $class = shift;
42  
43 7 ▶ if ( 1 == @_ && !ref $_[0] ) {
Branch: 1 branch
BranchTrueFalseTotal
if (1 == @_ and not ref $_[0]) 0 7 7
Condition33%1/3
1 == @_ and not ref $_[0]
!ll&&!rl&&r
700
MC/DC0%0/2
1 == @_ and not ref $_[0]
1 == @_ not ref $_[0]
Truth table33%1/3
A and not(B)
A= 1 == @_B= not ref $_[0]
ABresult
0X0
100
111
44 0 push @_, undef;
45 }
46 7 ▶ if ( 2 == @_ && !ref $_[0] ) {
Branch: 1 branch
BranchTrueFalseTotal
if (2 == @_ and not ref $_[0]) 0 7 7
Condition33%1/3
2 == @_ and not ref $_[0]
!ll&&!rl&&r
700
MC/DC0%0/2
2 == @_ and not ref $_[0]
2 == @_ not ref $_[0]
Truth table33%1/3
A and not(B)
A= 2 == @_B= not ref $_[0]
ABresult
0X0
100
111
47 0 push @_, 0;
48 }
49 7 ▶ if ( @_ == $MORE_ARGS && !ref $_[0] ) {
Branch: 1 branch
BranchTrueFalseTotal
if (@_ == $MORE_ARGS and not ref $_[0]) 2 5 7
Condition66%2/3
@_ == $MORE_ARGS and not ref $_[0]
!ll&&!rl&&r
502
MC/DC50%1/2
@_ == $MORE_ARGS and not ref $_[0]
@_ == $MORE_ARGS not ref $_[0]
Truth table66%2/3
A and not(B)
A= @_ == $MORE_ARGSB= not ref $_[0]
ABresult
0X0
100
111
50 2 return $class->$orig(
51 '_name' => $_[0],
52 '_value' => $_[1],
53 '_public' => $_[2],
54 );
55 }
56 5 return $class->$orig(@_);
57 4 };
58  
59 4 ▶no Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
60  
61 4 __PACKAGE__->meta->make_immutable;
62  
63 4 1;
64  
65 __END__
66  
67 =encoding utf8
68  
69 =for stopwords Bitbucket boolean Readonly Ipenburg MERCHANTABILITY
70  
71 =head1 NAME
72  
73 WWW::Wookie::Widget::Property - Property class
74  
75 =head1 VERSION
76  
77 This document describes WWW::Wookie::Widget::Property version C<v1.1.3>
78  
79 =head1 SYNOPSIS
80  
81 use WWW::Wookie::Widget::Property;
82 $p = WWW::Wookie::Widget::Property->new($name, $value, 0);
83  
84 =head1 DESCRIPTION
85  
86 =head1 SUBROUTINES/METHODS
87  
88 =head2 C<new>
89  
90 Construct a new property.
91  
92 =over
93  
94 =item 1. Property name as string
95  
96 =item 2. Property value as string
97  
98 =item 3. Is property public (handled as shared data key) or private as boolean
99  
100 =back
101  
102 =head2 C<getValue>
103  
104 Get property value. Returns value of property as sting.
105  
106 =head2 C<getName>
107  
108 Get property name. Returns name of property as sting.
109  
110 =head2 C<isPublic>
111  
112 Get property C<isPublic> flag. Return the C<isPublic> flag of the property as
113 string.
114  
115 =head2 C<setValue>
116  
117 Set property value.
118  
119 =over
120  
121 =item 1. New value as string
122  
123 =back
124  
125 =head2 C<setName>
126  
127 Set property name.
128  
129 =over
130  
131 =item 1. New name as string
132  
133 =back
134  
135 =head2 C<setIsPublic>
136  
137 Set C<isPublic> flag, 1 or 0.
138  
139 =over
140  
141 =item 1. Flag 1 or 0
142  
143 =back
144  
145 =head1 CONFIGURATION AND ENVIRONMENT
146  
147 =head1 DEPENDENCIES
148  
149 =over 4
150  
151 =item * L<Moose|Moose>
152  
153 =item * L<Readonly|Readonly>
154  
155 =item * L<namespace::autoclean|namespace::autoclean>
156  
157 =back
158  
159 =head1 INCOMPATIBILITIES
160  
161 =head1 DIAGNOSTICS
162  
163 =head1 BUGS AND LIMITATIONS
164  
165 Please report any bugs or feature requests at
166 L<Bitbucket|https://bitbucket.org/rolandvanipenburg/www-wookie/issues>.
167  
168 =head1 AUTHOR
169  
170 Roland van Ipenburg, E<lt>roland@rolandvanipenburg.comE<gt>
171  
172 =head1 LICENSE AND COPYRIGHT
173  
174 Copyright 2010-2021 by Roland van Ipenburg
175  
176 This library is free software; you can redistribute it and/or modify
177 it under the same terms as Perl itself, either Perl version 5.14.0 or,
178 at your option, any later version of Perl 5 you may have available.
179  
180 =head1 DISCLAIMER OF WARRANTY
181  
182 BECAUSE THIS SOFTWARE IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
183 FOR THE SOFTWARE, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
184 OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
185 PROVIDE THE SOFTWARE "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
186 EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
187 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE
188 ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE SOFTWARE IS WITH
189 YOU. SHOULD THE SOFTWARE PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL
190 NECESSARY SERVICING, REPAIR, OR CORRECTION.
191  
192 IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
193 WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
194 REDISTRIBUTE THE SOFTWARE AS PERMITTED BY THE ABOVE LICENSE, BE
195 LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL,
196 OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE
197 THE SOFTWARE (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
198 RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
199 FAILURE OF THE SOFTWARE TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
200 SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
201 SUCH DAMAGES.
202  
203 =cut
« Build ↑ Summary blib/lib/WWW/Wookie/Server/Connection.pm »