| 1 | # -*- cperl; cperl-indent-level: 4 -*- | ||||||||||||||||||||||||||||
| 2 | # Copyright (C) 2010-2021, Roland van Ipenburg | ||||||||||||||||||||||||||||
| 3 | package WWW::Wookie::Widget::Instance 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 => 5; | |||||||||||||||||||||||||||
| 16 | ## use critic | ||||||||||||||||||||||||||||
| 17 | |||||||||||||||||||||||||||||
| 18 | 4 | has '_url' => ( | |||||||||||||||||||||||||||
| 19 | 'is' => 'rw', | ||||||||||||||||||||||||||||
| 20 | 'isa' => 'Str', | ||||||||||||||||||||||||||||
| 21 | 'reader' => 'getUrl', | ||||||||||||||||||||||||||||
| 22 | 'writer' => 'setUrl', | ||||||||||||||||||||||||||||
| 23 | ); | ||||||||||||||||||||||||||||
| 24 | |||||||||||||||||||||||||||||
| 25 | 4 | has '_guid' => ( | |||||||||||||||||||||||||||
| 26 | 'is' => 'rw', | ||||||||||||||||||||||||||||
| 27 | 'isa' => 'Str', | ||||||||||||||||||||||||||||
| 28 | 'reader' => 'getIdentifier', | ||||||||||||||||||||||||||||
| 29 | 'writer' => 'setIdentifier', | ||||||||||||||||||||||||||||
| 30 | ); | ||||||||||||||||||||||||||||
| 31 | |||||||||||||||||||||||||||||
| 32 | 4 | has '_title' => ( | |||||||||||||||||||||||||||
| 33 | 'is' => 'rw', | ||||||||||||||||||||||||||||
| 34 | 'isa' => 'Str', | ||||||||||||||||||||||||||||
| 35 | 'reader' => 'getTitle', | ||||||||||||||||||||||||||||
| 36 | 'writer' => 'setTitle', | ||||||||||||||||||||||||||||
| 37 | ); | ||||||||||||||||||||||||||||
| 38 | |||||||||||||||||||||||||||||
| 39 | 4 | has '_height' => ( | |||||||||||||||||||||||||||
| 40 | 'is' => 'rw', | ||||||||||||||||||||||||||||
| 41 | 'isa' => 'Int', | ||||||||||||||||||||||||||||
| 42 | 'reader' => 'getHeight', | ||||||||||||||||||||||||||||
| 43 | 'writer' => 'setHeight', | ||||||||||||||||||||||||||||
| 44 | ); | ||||||||||||||||||||||||||||
| 45 | |||||||||||||||||||||||||||||
| 46 | 4 | has '_width' => ( | |||||||||||||||||||||||||||
| 47 | 'is' => 'rw', | ||||||||||||||||||||||||||||
| 48 | 'isa' => 'Int', | ||||||||||||||||||||||||||||
| 49 | 'reader' => 'getWidth', | ||||||||||||||||||||||||||||
| 50 | 'writer' => 'setWidth', | ||||||||||||||||||||||||||||
| 51 | ); | ||||||||||||||||||||||||||||
| 52 | |||||||||||||||||||||||||||||
| 53 | around 'BUILDARGS' => sub { | ||||||||||||||||||||||||||||
| 54 | 12 | ▶ | my $orig = shift; | ||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=3 SCAR=13.5
| |||||||||||||||||||||||||||||
| 55 | 12 | my $class = shift; | |||||||||||||||||||||||||||
| 56 | |||||||||||||||||||||||||||||
| 57 | 12 | ▶ | 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]
| |||||||||||||||||||||||||||||
| 58 | 0 | my ( $url, $guid, $title, $height, $width ) = @_; | |||||||||||||||||||||||||||
| 59 | 0 | return $class->$orig( | |||||||||||||||||||||||||||
| 60 | '_url' => $url, | ||||||||||||||||||||||||||||
| 61 | '_guid' => $guid, | ||||||||||||||||||||||||||||
| 62 | '_title' => $title, | ||||||||||||||||||||||||||||
| 63 | '_height' => $height, | ||||||||||||||||||||||||||||
| 64 | '_width' => $width, | ||||||||||||||||||||||||||||
| 65 | ); | ||||||||||||||||||||||||||||
| 66 | } | ||||||||||||||||||||||||||||
| 67 | 12 | return $class->$orig(@_); | |||||||||||||||||||||||||||
| 68 | 4 | }; | |||||||||||||||||||||||||||
| 69 | |||||||||||||||||||||||||||||
| 70 | 4 | ▶ | no Moose; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 71 | |||||||||||||||||||||||||||||
| 72 | 4 | __PACKAGE__->meta->make_immutable; | |||||||||||||||||||||||||||
| 73 | |||||||||||||||||||||||||||||
| 74 | 4 | 1; | |||||||||||||||||||||||||||
| 75 | |||||||||||||||||||||||||||||
| 76 | __END__ | ||||||||||||||||||||||||||||
| 77 | |||||||||||||||||||||||||||||
| 78 | =encoding utf8 | ||||||||||||||||||||||||||||
| 79 | |||||||||||||||||||||||||||||
| 80 | =for stopwords Bitbucket Url Guid url guid Readonly Ipenburg MERCHANTABILITY | ||||||||||||||||||||||||||||
| 81 | |||||||||||||||||||||||||||||
| 82 | =head1 NAME | ||||||||||||||||||||||||||||
| 83 | |||||||||||||||||||||||||||||
| 84 | WWW::Wookie::Widget::Instance - An instance of a widget for use on the client | ||||||||||||||||||||||||||||
| 85 | |||||||||||||||||||||||||||||
| 86 | =head1 VERSION | ||||||||||||||||||||||||||||
| 87 | |||||||||||||||||||||||||||||
| 88 | This document describes WWW::Wookie::Widget::Instance version C<v1.1.3> | ||||||||||||||||||||||||||||
| 89 | |||||||||||||||||||||||||||||
| 90 | =head1 SYNOPSIS | ||||||||||||||||||||||||||||
| 91 | |||||||||||||||||||||||||||||
| 92 | use WWW::Wookie::Widget::Instance; | ||||||||||||||||||||||||||||
| 93 | $i = WWW::Wookie::Widget::Instance->new( | ||||||||||||||||||||||||||||
| 94 | $url, $guid, $title, $height, $width); | ||||||||||||||||||||||||||||
| 95 | |||||||||||||||||||||||||||||
| 96 | =head1 DESCRIPTION | ||||||||||||||||||||||||||||
| 97 | |||||||||||||||||||||||||||||
| 98 | =head1 SUBROUTINES/METHODS | ||||||||||||||||||||||||||||
| 99 | |||||||||||||||||||||||||||||
| 100 | =head2 C<new> | ||||||||||||||||||||||||||||
| 101 | |||||||||||||||||||||||||||||
| 102 | Initialize new widget instance. | ||||||||||||||||||||||||||||
| 103 | |||||||||||||||||||||||||||||
| 104 | =over | ||||||||||||||||||||||||||||
| 105 | |||||||||||||||||||||||||||||
| 106 | =item 1. Url of the widget as string | ||||||||||||||||||||||||||||
| 107 | |||||||||||||||||||||||||||||
| 108 | =item 2. Guid of the widget as string | ||||||||||||||||||||||||||||
| 109 | |||||||||||||||||||||||||||||
| 110 | =item 3. Title of the widget as string | ||||||||||||||||||||||||||||
| 111 | |||||||||||||||||||||||||||||
| 112 | =item 4. Height of the widget as string | ||||||||||||||||||||||||||||
| 113 | |||||||||||||||||||||||||||||
| 114 | =item 5. Width of the widget as string | ||||||||||||||||||||||||||||
| 115 | |||||||||||||||||||||||||||||
| 116 | =back | ||||||||||||||||||||||||||||
| 117 | |||||||||||||||||||||||||||||
| 118 | =head2 C<getUrl> | ||||||||||||||||||||||||||||
| 119 | |||||||||||||||||||||||||||||
| 120 | Get widget instance url. Returns widget instance url as string. | ||||||||||||||||||||||||||||
| 121 | |||||||||||||||||||||||||||||
| 122 | =head2 C<setUrl> | ||||||||||||||||||||||||||||
| 123 | |||||||||||||||||||||||||||||
| 124 | Set widget instance url. | ||||||||||||||||||||||||||||
| 125 | |||||||||||||||||||||||||||||
| 126 | =over | ||||||||||||||||||||||||||||
| 127 | |||||||||||||||||||||||||||||
| 128 | =item 1. New url for instance as string | ||||||||||||||||||||||||||||
| 129 | |||||||||||||||||||||||||||||
| 130 | =back | ||||||||||||||||||||||||||||
| 131 | |||||||||||||||||||||||||||||
| 132 | =head2 C<getIdentifier> | ||||||||||||||||||||||||||||
| 133 | |||||||||||||||||||||||||||||
| 134 | Get widget guid value. Returns guid of widget as string. | ||||||||||||||||||||||||||||
| 135 | |||||||||||||||||||||||||||||
| 136 | =head2 C<setIdentifier> | ||||||||||||||||||||||||||||
| 137 | |||||||||||||||||||||||||||||
| 138 | Set widget guid value. | ||||||||||||||||||||||||||||
| 139 | |||||||||||||||||||||||||||||
| 140 | =over | ||||||||||||||||||||||||||||
| 141 | |||||||||||||||||||||||||||||
| 142 | =item 1. Guid value as string | ||||||||||||||||||||||||||||
| 143 | |||||||||||||||||||||||||||||
| 144 | =back | ||||||||||||||||||||||||||||
| 145 | |||||||||||||||||||||||||||||
| 146 | =head2 C<getTitle> | ||||||||||||||||||||||||||||
| 147 | |||||||||||||||||||||||||||||
| 148 | Get widget title. Returns widget title as string. | ||||||||||||||||||||||||||||
| 149 | |||||||||||||||||||||||||||||
| 150 | =head2 C<setTitle> | ||||||||||||||||||||||||||||
| 151 | |||||||||||||||||||||||||||||
| 152 | Set widget title. | ||||||||||||||||||||||||||||
| 153 | |||||||||||||||||||||||||||||
| 154 | =over | ||||||||||||||||||||||||||||
| 155 | |||||||||||||||||||||||||||||
| 156 | =item 1. New widget title as string | ||||||||||||||||||||||||||||
| 157 | |||||||||||||||||||||||||||||
| 158 | =back | ||||||||||||||||||||||||||||
| 159 | |||||||||||||||||||||||||||||
| 160 | =head2 C<getHeight> | ||||||||||||||||||||||||||||
| 161 | |||||||||||||||||||||||||||||
| 162 | Get widget height. Returns widget height as integer. | ||||||||||||||||||||||||||||
| 163 | |||||||||||||||||||||||||||||
| 164 | =head2 C<setHeight> | ||||||||||||||||||||||||||||
| 165 | |||||||||||||||||||||||||||||
| 166 | Set widget height. | ||||||||||||||||||||||||||||
| 167 | |||||||||||||||||||||||||||||
| 168 | =over | ||||||||||||||||||||||||||||
| 169 | |||||||||||||||||||||||||||||
| 170 | =item 1. New widget height as integer | ||||||||||||||||||||||||||||
| 171 | |||||||||||||||||||||||||||||
| 172 | =back | ||||||||||||||||||||||||||||
| 173 | |||||||||||||||||||||||||||||
| 174 | =head2 C<getWidth> | ||||||||||||||||||||||||||||
| 175 | |||||||||||||||||||||||||||||
| 176 | Get widget width. Return widget width as integer. | ||||||||||||||||||||||||||||
| 177 | |||||||||||||||||||||||||||||
| 178 | =head2 C<setWidth> | ||||||||||||||||||||||||||||
| 179 | |||||||||||||||||||||||||||||
| 180 | Set widget width. | ||||||||||||||||||||||||||||
| 181 | |||||||||||||||||||||||||||||
| 182 | =over | ||||||||||||||||||||||||||||
| 183 | |||||||||||||||||||||||||||||
| 184 | =item 1. New widget width as integer | ||||||||||||||||||||||||||||
| 185 | |||||||||||||||||||||||||||||
| 186 | =back | ||||||||||||||||||||||||||||
| 187 | |||||||||||||||||||||||||||||
| 188 | =head1 CONFIGURATION AND ENVIRONMENT | ||||||||||||||||||||||||||||
| 189 | |||||||||||||||||||||||||||||
| 190 | =head1 DEPENDENCIES | ||||||||||||||||||||||||||||
| 191 | |||||||||||||||||||||||||||||
| 192 | =over 4 | ||||||||||||||||||||||||||||
| 193 | |||||||||||||||||||||||||||||
| 194 | =item * L<Moose|Moose> | ||||||||||||||||||||||||||||
| 195 | |||||||||||||||||||||||||||||
| 196 | =item * L<Readonly|Readonly> | ||||||||||||||||||||||||||||
| 197 | |||||||||||||||||||||||||||||
| 198 | =item * L<namespace::autoclean|namespace::autoclean> | ||||||||||||||||||||||||||||
| 199 | |||||||||||||||||||||||||||||
| 200 | =back | ||||||||||||||||||||||||||||
| 201 | |||||||||||||||||||||||||||||
| 202 | =head1 INCOMPATIBILITIES | ||||||||||||||||||||||||||||
| 203 | |||||||||||||||||||||||||||||
| 204 | =head1 DIAGNOSTICS | ||||||||||||||||||||||||||||
| 205 | |||||||||||||||||||||||||||||
| 206 | =head1 BUGS AND LIMITATIONS | ||||||||||||||||||||||||||||
| 207 | |||||||||||||||||||||||||||||
| 208 | Please report any bugs or feature requests at | ||||||||||||||||||||||||||||
| 209 | L<Bitbucket|https://bitbucket.org/rolandvanipenburg/www-wookie/issues>. | ||||||||||||||||||||||||||||
| 210 | |||||||||||||||||||||||||||||
| 211 | =head1 AUTHOR | ||||||||||||||||||||||||||||
| 212 | |||||||||||||||||||||||||||||
| 213 | Roland van Ipenburg, E<lt>roland@rolandvanipenburg.comE<gt> | ||||||||||||||||||||||||||||
| 214 | |||||||||||||||||||||||||||||
| 215 | =head1 LICENSE AND COPYRIGHT | ||||||||||||||||||||||||||||
| 216 | |||||||||||||||||||||||||||||
| 217 | Copyright 2010-2021 by Roland van Ipenburg | ||||||||||||||||||||||||||||
| 218 | |||||||||||||||||||||||||||||
| 219 | This library is free software; you can redistribute it and/or modify | ||||||||||||||||||||||||||||
| 220 | it under the same terms as Perl itself, either Perl version 5.14.0 or, | ||||||||||||||||||||||||||||
| 221 | at your option, any later version of Perl 5 you may have available. | ||||||||||||||||||||||||||||
| 222 | |||||||||||||||||||||||||||||
| 223 | =head1 DISCLAIMER OF WARRANTY | ||||||||||||||||||||||||||||
| 224 | |||||||||||||||||||||||||||||
| 225 | BECAUSE THIS SOFTWARE IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY | ||||||||||||||||||||||||||||
| 226 | FOR THE SOFTWARE, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN | ||||||||||||||||||||||||||||
| 227 | OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES | ||||||||||||||||||||||||||||
| 228 | PROVIDE THE SOFTWARE "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER | ||||||||||||||||||||||||||||
| 229 | EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||||||||||||||||||||||||||||
| 230 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE | ||||||||||||||||||||||||||||
| 231 | ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE SOFTWARE IS WITH | ||||||||||||||||||||||||||||
| 232 | YOU. SHOULD THE SOFTWARE PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL | ||||||||||||||||||||||||||||
| 233 | NECESSARY SERVICING, REPAIR, OR CORRECTION. | ||||||||||||||||||||||||||||
| 234 | |||||||||||||||||||||||||||||
| 235 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING | ||||||||||||||||||||||||||||
| 236 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR | ||||||||||||||||||||||||||||
| 237 | REDISTRIBUTE THE SOFTWARE AS PERMITTED BY THE ABOVE LICENSE, BE | ||||||||||||||||||||||||||||
| 238 | LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL, | ||||||||||||||||||||||||||||
| 239 | OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE | ||||||||||||||||||||||||||||
| 240 | THE SOFTWARE (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING | ||||||||||||||||||||||||||||
| 241 | RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A | ||||||||||||||||||||||||||||
| 242 | FAILURE OF THE SOFTWARE TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF | ||||||||||||||||||||||||||||
| 243 | SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF | ||||||||||||||||||||||||||||
| 244 | SUCH DAMAGES. | ||||||||||||||||||||||||||||
| 245 | |||||||||||||||||||||||||||||
| 246 | =cut | ||||||||||||||||||||||||||||