File Coverage

blib/lib/WWW/Wookie/Widget/Instances.pm
Criterion Covered Total %
statement 23 28 82.1
branch n/a
condition n/a
subroutine 8 10 80.0
pod 2 2 100.0
total 33 40 82.5


line stmt bran cond sub pod time code
1             # -*- cperl; cperl-indent-level: 4 -*-
2             # Copyright (C) 2010-2021, Roland van Ipenburg
3             package WWW::Wookie::Widget::Instances v1.1.2;
4 4     4   1361 use strict;
  4         10  
  4         148  
5 4     4   27 use warnings;
  4         9  
  4         161  
6              
7 4     4   28 use utf8;
  4         10  
  4         41  
8 4     4   187 use 5.020000;
  4         17  
9              
10 4     4   23 use Moose qw/around has/;
  4         8  
  4         31  
11 4     4   23521 use namespace::autoclean '-except' => 'meta', '-also' => qr/^_/sxm;
  4         14  
  4         56  
12              
13 4     4   442 use WWW::Wookie::Widget::Instance;
  4         10  
  4         716  
14              
15             has '_instances' => (
16             'traits' => ['Hash'],
17             'is' => 'rw',
18             'isa' => 'HashRef[WWW::Wookie::Widget::Instance]',
19             'default' => sub { {} },
20             );
21              
22             sub put {
23 0     0 1   my ( $self, $instance ) = @_;
24 0           $self->_instances->{ $instance->getIdentifier } = $instance;
25 0           return;
26             }
27              
28             sub get {
29 0     0 1   my $self = shift;
30 0           return $self->_instances;
31             }
32              
33 4     4   37 no Moose;
  4         10  
  4         33  
34              
35             __PACKAGE__->meta->make_immutable;
36              
37             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.2>
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