blib/lib/WWW/Wookie/Widget.pm

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