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