d41d73d8ba01398122842dd2d9bd99fc6b48659e
[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   # execute a sub on the value
29   print 10->do(sub { $_ * $_ }); # prints 100
30
31 =head1 DESCRIPTION
32
33 This is a role to describes a defined (non-reference) Perl value.
34
35 =head1 METHODS
36
37 =over 4
38
39 =item B<meta>
40
41 =item B<do (\&block)>
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