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