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