blib/lib/WWW/Wookie/Widget/Instances.pm

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