Commit | Line | Data |
5f654d8e |
1 | package Moose::Autobox::Scalar; |
2 | use Moose::Role 'with'; |
3 | |
e3598a18 |
4 | our $VERSION = '0.10'; |
5f654d8e |
5 | |
31d40d73 |
6 | with 'Moose::Autobox::String', |
7 | 'Moose::Autobox::Number'; |
e29de5ed |
8 | |
9 | sub flatten { $_[0] } |
3f4dd8b7 |
10 | sub print { CORE::print $_[0] } |
11 | sub say { CORE::print $_[0], "\n" } |
31d40d73 |
12 | 1; |
13 | |
14 | __END__ |
15 | |
16 | =pod |
17 | |
18 | =head1 NAME |
19 | |
20 | Moose::Autobox::Scalar - the Scalar role |
21 | |
31d40d73 |
22 | =head1 DESCRIPTION |
23 | |
8937074a |
24 | This is a role to describes a Scalar value, which is defined |
25 | as the combination (union sort of) of a String and a Number. |
26 | |
260cc81f |
27 | =head1 METHODS |
28 | |
29 | =over 4 |
30 | |
31 | =item B<meta> |
32 | |
3f4dd8b7 |
33 | =item B<print> |
34 | |
35 | =item B<say> |
36 | |
e29de5ed |
37 | =item B<flatten> |
38 | |
39 | Flattening a scalar just returns the scalar. This means that you can say: |
40 | |
41 | my @array = $input->flatten; |
42 | |
43 | # Given $input of 5, @array is (5); |
44 | # Given $input of [ 5, 2, 0], @array is (5, 2, 0) |
45 | |
260cc81f |
46 | =back |
47 | |
31d40d73 |
48 | =head1 BUGS |
49 | |
50 | All complex software has bugs lurking in it, and this module is no |
51 | exception. If you find a bug please either email me, or add the bug |
52 | to cpan-RT. |
53 | |
54 | =head1 AUTHOR |
55 | |
56 | Stevan Little E<lt>stevan@iinteractive.comE<gt> |
57 | |
58 | =head1 COPYRIGHT AND LICENSE |
59 | |
ea4e64bf |
60 | Copyright 2006-2008 by Infinity Interactive, Inc. |
31d40d73 |
61 | |
62 | L<http://www.iinteractive.com> |
63 | |
64 | This library is free software; you can redistribute it and/or modify |
65 | it under the same terms as Perl itself. |
66 | |
3f4dd8b7 |
67 | =cut |