Add built local::lib
[catagits/Gitalist.git] / local-lib5 / lib / perl5 / Moose / Autobox / Number.pm
CommitLineData
3fea05b9 1package Moose::Autobox::Number;
2use Moose::Role;
3
4our $VERSION = '0.10';
5
6with 'Moose::Autobox::Value';
7
8sub to {
9 return [ $_[0] .. $_[1] ] if $_[0] <= $_[1];
10 return [ reverse $_[1] .. $_[0] ];
11}
12
131;
14
15__END__
16
17=pod
18
19=head1 NAME
20
21Moose::Autobox::Number - the Number role
22
23=head1 DESCRIPTION
24
25This is a role to describes a Numeric value.
26
27=head1 METHODS
28
29=over 4
30
31=item B<to>
32
33Takes another number as argument and produces an array ranging from
34the number the method is called on to the number given as argument. In
35some situations, this method intentionally behaves different from the
36range operator in perl:
37
38 $foo = [ 5 .. 1 ]; # $foo is []
39
40 $foo = 5->to(1); # $foo is [ 5, 4, 3, 2, 1 ]
41
42=back
43
44=over 4
45
46=item B<meta>
47
48=back
49
50=head1 BUGS
51
52All complex software has bugs lurking in it, and this module is no
53exception. If you find a bug please either email me, or add the bug
54to cpan-RT.
55
56=head1 AUTHOR
57
58Stevan Little E<lt>stevan@iinteractive.comE<gt>
59
60=head1 COPYRIGHT AND LICENSE
61
62Copyright 2006-2008 by Infinity Interactive, Inc.
63
64L<http://www.iinteractive.com>
65
66This library is free software; you can redistribute it and/or modify
67it under the same terms as Perl itself.
68
69=cut