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