File Coverage

blib/lib/Acme/Dahut/Call.pm
Criterion Covered Total %
statement 4 6 66.6
branch n/a
condition n/a
subroutine 2 2 100.0
pod n/a
total 6 8 75.0


line stmt bran cond sub pod time code
1             package Acme::Dahut::Call;
2 1     1   25681 use strict;
  1         3  
  1         59  
3 1     1   772 use Moose;
  0            
  0            
4             our $VERSION = '0.03';
5              
6             has calls => (
7             isa => 'ArrayRef',
8             is => 'ro',
9             auto_deref => 1,
10             default => sub {
11             [
12             (
13             '*yarg*', 'Yo kids!',
14             'DAAAHUUUUUT!!!!', 'DAAAAAHUUUT!',
15             'METADATA!', 'Yo kids!',
16             'DAAAAAHUUUUUUT!!', 'METADATA!',
17             'Yo kids!', 'METADATA!',
18             'DAHUUT!!', 'A THUD!',
19             'AD HUT!', 'HAT DU!',
20             'AT HUD!', '-.. .- .... ..- -',
21             'DAHUUUUT!', 'DAAAHUUT',
22             'DAHUT?'
23             )
24             ];
25             },
26             );
27              
28             has actions => (
29             isa => 'ArrayRef',
30             is => 'ro',
31             auto_deref => 1,
32             default => sub {
33             [
34             (
35             'hides from the chaotic noise',
36             'topples down the mountain',
37             'scurries around in circles',
38             )
39             ];
40             },
41             );
42              
43             sub call {
44             my $self = shift;
45             my @calls = $self->calls;
46             return @calls[ rand scalar @calls ];
47             }
48              
49             sub action {
50             my $self = shift;
51             my @actions = $self->actions;
52             return @actions[ rand scalar @actions ];
53             }
54              
55             1;
56             __END__
57              
58             =head1 NAME
59              
60             Acme::Dahut::Call - replicates the melodious sound of the wild Dahut ... in Text.
61              
62              
63             =head1 VERSION
64              
65             This document describes Acme::Dahut::Call version 0.0.1
66              
67              
68             =head1 SYNOPSIS
69              
70             use Acme::Dahut::Call;
71             my $fauxhut = Acme::Dahut::Call->new();
72             print $fauxhut->call()
73            
74             =head1 DESCRIPTION
75              
76             The vocal ability of dahuts has inspired poets and musicians, from Chaucer to Wordsworth,
77             from Handel to Respighi. Dahutsong can be a natural phenomenon of intense beauty. But our
78             enjoyment is incidental to the main purpose, which is one dahut communicating with others.
79             Dahuts became the world's master musicians in order to convey to potential mates, rivals
80             and predators all the important things they have to say, from "Clear off!" to "Come on!"
81             to "Where's the Beer?"[1]
82              
83             =head1 METHODS
84              
85             =over
86              
87             =item new()
88              
89             Create a new Acme::Dahut::Call object. Because the melodious sound of the Dahut cannot be
90             captured all at one time you can pass in a new list of lines with the C<calls> or the C<actions> param.
91              
92             =item action()
93              
94             Simulates the more "active" response of a Dahut to it's native cry.
95              
96             =item actions()
97              
98             Returns an ArrayRef of all "active" responses.
99              
100             =item call()
101              
102             Returns a random call from the wild Dahut.
103              
104             =item calls()
105              
106             Returns an ArrayRef of all possible Dahut Calls.
107              
108             =item meta()
109              
110             Returns the Class metaobjbect. See L<Class::MOP::Class> for details.
111              
112             =back
113              
114             =head1 CONFIGURATION AND ENVIRONMENT
115              
116             =for author to fill in:
117             A full explanation of any configuration system(s) used by the
118             module, including the names and locations of any configuration
119             files, and the meaning of any environment variables or properties
120             that can be set. These descriptions must also include details of any
121             configuration language used.
122            
123             Acme::Dahut::Call requires no configuration files or environment variables.
124              
125              
126             =head1 DEPENDENCIES
127              
128             =for author to fill in:
129             A list of all the other modules that this module relies upon,
130             including any restrictions on versions, and an indication whether
131             the module is part of the standard Perl distribution, part of the
132             module's distribution, or must be installed separately. ]
133              
134             None.
135              
136              
137             =head1 INCOMPATIBILITIES
138              
139             =for author to fill in:
140             A list of any modules that this module cannot be used in conjunction
141             with. This may be due to name conflicts in the interface, or
142             competition for system or program resources, or due to internal
143             limitations of Perl (for example, many modules that use source code
144             filters are mutually incompatible).
145              
146             None reported.
147              
148              
149             =head1 BUGS AND LIMITATIONS
150              
151             =for author to fill in:
152             A list of known problems with the module, together with some
153             indication Whether they are likely to be fixed in an upcoming
154             release. Also a list of restrictions on the features the module
155             does provide: data types that cannot be handled, performance issues
156             and the circumstances in which they may arise, practical
157             limitations on the size of data sets, special cases that are not
158             (yet) handled, etc.
159              
160             No bugs have been reported.
161              
162             Please report any bugs or feature requests to
163             C<bug-acme-dahut-call@rt.cpan.org>, or through the web interface at
164             L<http://rt.cpan.org>.
165              
166             =head1 SEE ALSO
167              
168             L<Acme::Dahut>
169              
170             =head1 AUTHOR
171              
172             Chris Prather C<< <perigrin@cpan.org> >>
173              
174              
175             =head1 LICENCE AND COPYRIGHT
176              
177             Copyright (c) 2007, Chris Prather C<< <perigrin@cpan.org> >>. All rights reserved.
178              
179             This module is free software; you can redistribute it and/or
180             modify it under the same terms as Perl itself. See L<perlartistic>.
181              
182              
183             =head1 DISCLAIMER OF WARRANTY
184              
185             BECAUSE THIS SOFTWARE IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
186             FOR THE SOFTWARE, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
187             OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
188             PROVIDE THE SOFTWARE "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
189             EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
190             WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE
191             ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE SOFTWARE IS WITH
192             YOU. SHOULD THE SOFTWARE PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL
193             NECESSARY SERVICING, REPAIR, OR CORRECTION.
194              
195             IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
196             WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
197             REDISTRIBUTE THE SOFTWARE AS PERMITTED BY THE ABOVE LICENCE, BE
198             LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL,
199             OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE
200             THE SOFTWARE (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
201             RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
202             FAILURE OF THE SOFTWARE TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
203             SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
204             SUCH DAMAGES.