| 1 | # -*- cperl; cperl-indent-level: 4 -*- | ||
| 2 | # Copyright (C) 2010-2021, Roland van Ipenburg | ||
| 3 | package WWW::Wookie::Widget::Instances 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 WWW::Wookie::Widget::Instance; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 14 | |||
| 15 | has '_instances' => ( | ||
| 16 | 'traits' => ['Hash'], | ||
| 17 | 'is' => 'rw', | ||
| 18 | 'isa' => 'HashRef[WWW::Wookie::Widget::Instance]', | ||
| 19 | 20 | ▶ | 'default' => sub { {} }, |
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||
| 20 | 4 | ); | |
| 21 | |||
| 22 | sub put { | ||
| 23 | 0 | ▶ | my ( $self, $instance ) = @_; |
|
Subroutine
put: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 24 | 0 | $self->_instances->{ $instance->getIdentifier } = $instance; | |
| 25 | 0 | return; | |
| 26 | } | ||
| 27 | |||
| 28 | sub get { | ||
| 29 | 0 | ▶ | my $self = shift; |
|
Subroutine
get: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 30 | 0 | return $self->_instances; | |
| 31 | } | ||
| 32 | |||
| 33 | 4 | ▶ | no Moose; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 34 | |||
| 35 | 4 | __PACKAGE__->meta->make_immutable; | |
| 36 | |||
| 37 | 4 | 1; | |
| 38 | |||
| 39 | __END__ | ||
| 40 | |||
| 41 | =encoding utf8 | ||
| 42 | |||
| 43 | =for stopwords Bitbucket Ipenburg MERCHANTABILITY | ||
| 44 | |||
| 45 | =head1 NAME | ||
| 46 | |||
| 47 | WWW::Wookie::Widget::Instances - A collection of known widget instances | ||
| 48 | available to a host | ||
| 49 | |||
| 50 | =head1 VERSION | ||
| 51 | |||
| 52 | This document describes WWW::Wookie::Widget::Instances version C<v1.1.3> | ||
| 53 | |||
| 54 | =head1 SYNOPSIS | ||
| 55 | |||
| 56 | use WWW::Wookie::Widget::Instances; | ||
| 57 | $i = WWW::Wookie::Widget::Instances->new(); | ||
| 58 | |||
| 59 | =head1 DESCRIPTION | ||
| 60 | |||
| 61 | =head1 SUBROUTINES/METHODS | ||
| 62 | |||
| 63 | =head2 C<new> | ||
| 64 | |||
| 65 | Create an empty collection. | ||
| 66 | |||
| 67 | =head2 C<put> | ||
| 68 | |||
| 69 | Record an instance of the given widget. | ||
| 70 | |||
| 71 | =over | ||
| 72 | |||
| 73 | =item 1. Instance of widget as | ||
| 74 | L<WWW::Wookie::Widget::Instance|WWW::Wookie::Widget::Instance> object | ||
| 75 | |||
| 76 | =back | ||
| 77 | |||
| 78 | =head2 C<get> | ||
| 79 | |||
| 80 | Get all Widget instances. Returns an array of widget instances. | ||
| 81 | |||
| 82 | =head1 CONFIGURATION AND ENVIRONMENT | ||
| 83 | |||
| 84 | =head1 DEPENDENCIES | ||
| 85 | |||
| 86 | =over 4 | ||
| 87 | |||
| 88 | =item * L<Moose|Moose> | ||
| 89 | |||
| 90 | =item * L<WWW::Wookie::Widget::Instance|WWW::Wookie::Widget::Instance> | ||
| 91 | |||
| 92 | =item * L<namespace::autoclean|namespace::autoclean> | ||
| 93 | |||
| 94 | =back | ||
| 95 | |||
| 96 | =head1 INCOMPATIBILITIES | ||
| 97 | |||
| 98 | =head1 DIAGNOSTICS | ||
| 99 | |||
| 100 | =head1 BUGS AND LIMITATIONS | ||
| 101 | |||
| 102 | Please report any bugs or feature requests at | ||
| 103 | L<Bitbucket|https://bitbucket.org/rolandvanipenburg/www-wookie/issues>. | ||
| 104 | |||
| 105 | =head1 AUTHOR | ||
| 106 | |||
| 107 | Roland van Ipenburg, E<lt>roland@rolandvanipenburg.comE<gt> | ||
| 108 | |||
| 109 | =head1 LICENSE AND COPYRIGHT | ||
| 110 | |||
| 111 | Copyright 2010-2021 by Roland van Ipenburg | ||
| 112 | |||
| 113 | This library is free software; you can redistribute it and/or modify | ||
| 114 | it under the same terms as Perl itself, either Perl version 5.14.0 or, | ||
| 115 | at your option, any later version of Perl 5 you may have available. | ||
| 116 | |||
| 117 | =head1 DISCLAIMER OF WARRANTY | ||
| 118 | |||
| 119 | BECAUSE THIS SOFTWARE IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY | ||
| 120 | FOR THE SOFTWARE, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN | ||
| 121 | OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES | ||
| 122 | PROVIDE THE SOFTWARE "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 123 | EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
| 124 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE | ||
| 125 | ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE SOFTWARE IS WITH | ||
| 126 | YOU. SHOULD THE SOFTWARE PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL | ||
| 127 | NECESSARY SERVICING, REPAIR, OR CORRECTION. | ||
| 128 | |||
| 129 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING | ||
| 130 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR | ||
| 131 | REDISTRIBUTE THE SOFTWARE AS PERMITTED BY THE ABOVE LICENSE, BE | ||
| 132 | LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL, | ||
| 133 | OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE | ||
| 134 | THE SOFTWARE (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING | ||
| 135 | RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A | ||
| 136 | FAILURE OF THE SOFTWARE TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF | ||
| 137 | SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF | ||
| 138 | SUCH DAMAGES. | ||
| 139 | |||
| 140 | =cut | ||