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

filter: Statementstmt 81.0% 30 / 37 Branchbran 50.0% 1 / 2 Conditioncond 33.3% 1 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 81.8% 9 / 11 Podpod 100% 2 / 2 totaltotal 75.4% 43 / 57 SCAR 11.4
CC
3
Cov
76%
__ANON__
3.8
put
2.0
get
2.0
CRAP 3.1
« blib/lib/WWW/Wookie/User.pm ↑ Summary blib/lib/WWW/Wookie/Widget.pm »
1 # -*- cperl; cperl-indent-level: 4 -*-
2 # Copyright (C) 2010-2021, Roland van Ipenburg
3 package WWW::Wookie::Widget::Category 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 has '_name' => (
14 'is' => 'ro',
15 'isa' => 'Str',
16 'reader' => 'getName',
17 );
18  
19 has '_widgets' => (
20 'traits' => ['Hash'],
21 'is' => 'rw',
22 'isa' => 'HashRef[WWW::Wookie::Widget]',
23 2 ▶ 'default' => sub { {} },
Subroutine __ANON__: called CC=1 SCAR=0.0
24 4 );
25  
26 sub put {
27 0 ▶ my ( $self, $widget ) = @_;
Subroutine put: not called CC=1 SCAR=6.9
Pod documented
28 0 $self->_widgets->{ $widget->getIdentifier } = $widget;
29 0 return;
30 }
31  
32 sub get {
33 0 ▶ my $self = shift;
Subroutine get: not called CC=1 SCAR=6.9
Pod documented
34 0 return $self->_widgets;
35 }
36  
37 around 'BUILDARGS' => sub {
38 2 ▶ my $orig = shift;
Subroutine __ANON__: called CC=3 SCAR=13.5
39 2 my $class = shift;
40  
41 2 ▶ if ( 1 == @_ && !ref $_[0] ) {
Branch: 1 branch
BranchTrueFalseTotal
if (1 == @_ and not ref $_[0]) 0 2 2
Condition33%1/3
1 == @_ and not ref $_[0]
!ll&&!rl&&r
200
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
42 0 my ($name) = @_;
43 0 return $class->$orig( '_name' => $name, );
44 }
45 2 return $class->$orig(@_);
46 4 };
47  
48 4 ▶no Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
49  
50 4 __PACKAGE__->meta->make_immutable;
51  
52 4 1;
53  
54 __END__
55  
56 =encoding utf8
57  
58 =for stopwords Bitbucket Ipenburg MERCHANTABILITY
59  
60 =head1 NAME
61  
62 WWW::Wookie::Widget::Category - client side representation of a widget service
63 category
64  
65 =head1 VERSION
66  
67 This document describes WWW::Wookie::Widget::Category version C<v1.1.3>
68  
69 =head1 SYNOPSIS
70  
71 use WWW::Wookie::Widget::Category;
72 $c = WWW::Wookie::Widget::Category->new($name);
73 $c->getName;
74  
75 =head1 DESCRIPTION
76  
77 =head1 SUBROUTINES/METHODS
78  
79 =head2 C<new>
80  
81 Create a new service type.
82  
83 =over
84  
85 =item 1. Service name as string
86  
87 =back
88  
89 =head2 C<getName>
90  
91 Gets the name of the service. Returns the name of the service as string.
92  
93 =head2 C<get>
94  
95 Gets the widgets available for this service. Returns an array of
96 L<WWW::Wookie::Widget|WWW::Wookie::Widget> objects.
97  
98 =head2 C<put>
99  
100 Adds a L<WWW::Wookie::Widget|WWW::Wookie::Widget> object to this service.
101  
102 =head1 CONFIGURATION AND ENVIRONMENT
103  
104 =head1 DEPENDENCIES
105  
106 =over 4
107  
108 =item * L<Moose|Moose>
109  
110 =item * L<namespace::autoclean|namespace::autoclean>
111  
112 =back
113  
114 =head1 INCOMPATIBILITIES
115  
116 =head1 DIAGNOSTICS
117  
118 =head1 BUGS AND LIMITATIONS
119  
120 Please report any bugs or feature requests at
121 L<Bitbucket|https://bitbucket.org/rolandvanipenburg/www-wookie/issues>.
122  
123 =head1 AUTHOR
124  
125 Roland van Ipenburg, E<lt>roland@rolandvanipenburg.comE<gt>
126  
127 =head1 LICENSE AND COPYRIGHT
128  
129 Copyright 2010-2021 by Roland van Ipenburg
130  
131 This library is free software; you can redistribute it and/or modify
132 it under the same terms as Perl itself, either Perl version 5.14.0 or,
133 at your option, any later version of Perl 5 you may have available.
134  
135 =head1 DISCLAIMER OF WARRANTY
136  
137 BECAUSE THIS SOFTWARE IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
138 FOR THE SOFTWARE, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
139 OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
140 PROVIDE THE SOFTWARE "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
141 EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
142 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE
143 ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE SOFTWARE IS WITH
144 YOU. SHOULD THE SOFTWARE PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL
145 NECESSARY SERVICING, REPAIR, OR CORRECTION.
146  
147 IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
148 WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
149 REDISTRIBUTE THE SOFTWARE AS PERMITTED BY THE ABOVE LICENSE, BE
150 LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL,
151 OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE
152 THE SOFTWARE (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
153 RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
154 FAILURE OF THE SOFTWARE TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
155 SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
156 SUCH DAMAGES.
157  
158 =cut
« blib/lib/WWW/Wookie/User.pm ↑ Summary blib/lib/WWW/Wookie/Widget.pm »