Beginning of dzilization
[gitmo/Moose.git] / lib / Moose / Meta / Method / Accessor / Native / String / inc.pm
CommitLineData
e7724627 1package Moose::Meta::Method::Accessor::Native::String::inc;
2
3use strict;
4use warnings;
5
e7724627 6our $AUTHORITY = 'cpan:STEVAN';
7
8b9641b8 8use Moose::Role;
9
10with 'Moose::Meta::Method::Accessor::Native::Writer' => {
11 -excludes => [
12 qw(
13 _maximum_arguments
a486d5ad 14 _inline_optimized_set_new_value
8b9641b8 15 )
16 ]
7f5ec80d 17 };
e7724627 18
e7724627 19sub _maximum_arguments { 0 }
20
21sub _potential_value {
53a4677c 22 my $self = shift;
23 my ($slot_access) = @_;
24
25 return '(do { '
26 . 'my $val = ' . $slot_access . '; '
27 . '$val++; '
28 . '$val; '
29 . '})';
e7724627 30}
31
a486d5ad 32sub _inline_optimized_set_new_value {
53a4677c 33 my $self = shift;
34 my ($inv, $new, $slot_access) = @_;
e7724627 35
a486d5ad 36 return $slot_access . '++;';
e7724627 37}
38
8b9641b8 39no Moose::Role;
40
e7724627 411;