foo
[gitmo/Moose-Autobox.git] / lib / Moose / Autobox / Value.pm
1 package Moose::Autobox::Value;     
2 use Moose::Role 'with', 'requires';
3
4 our $VERSION = '0.01';
5
6 with 'Moose::Autobox::Defined';
7
8 sub do { 
9     my ($self, $block) = @_;
10     local $_ = $self;
11     $block->($self);
12 }
13
14 1;
15 __END__
16
17 =pod
18
19 =head1 NAME 
20
21 Moose::Autobox::Value - the Value role
22
23 =head1 SYNOPOSIS
24
25   use Moose::Autobox;
26   use autobox;
27   
28   5->print; # prints 5
29   
30   # excute a sub on the value
31   10->do(sub { $_ + 15 })->print; # prints 25
32
33 =head1 DESCRIPTION
34
35 =head1 METHODS
36
37 =over 4
38
39 =item B<meta>
40
41 =item B<do>
42
43 =back
44
45 =head1 BUGS
46
47 All complex software has bugs lurking in it, and this module is no 
48 exception. If you find a bug please either email me, or add the bug
49 to cpan-RT.
50
51 =head1 AUTHOR
52
53 Stevan Little E<lt>stevan@iinteractive.comE<gt>
54
55 =head1 COPYRIGHT AND LICENSE
56
57 Copyright 2006 by Infinity Interactive, Inc.
58
59 L<http://www.iinteractive.com>
60
61 This library is free software; you can redistribute it and/or modify
62 it under the same terms as Perl itself.
63
64 =cut