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