stop using Module::Install
[gitmo/Moose-Autobox.git] / lib / Moose / Autobox / Number.pm
CommitLineData
31d40d73 1package Moose::Autobox::Number;
2use Moose::Role;
3
5efb6885 4our $VERSION = '0.14';
31d40d73 5
6with 'Moose::Autobox::Value';
f0f5341b 7
8sub to {
9 return [ $_[0] .. $_[1] ] if $_[0] <= $_[1];
10 return [ reverse $_[1] .. $_[0] ];
11}
12
31d40d73 131;
14
15__END__
16
17=pod
18
19=head1 NAME
20
21Moose::Autobox::Number - the Number role
22
31d40d73 23=head1 DESCRIPTION
24
8937074a 25This is a role to describes a Numeric value.
26
260cc81f 27=head1 METHODS
28
29=over 4
30
f0f5341b 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
f1f749bc 35some situations, this method intentionally behaves different from the
f0f5341b 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
260cc81f 46=item B<meta>
47
48=back
49
31d40d73 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
ea4e64bf 62Copyright 2006-2008 by Infinity Interactive, Inc.
31d40d73 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
caac33a3 69=cut