stop using excludes within moose, since it's no longer necessary
[gitmo/Moose.git] / lib / Moose / Meta / Method / Accessor / Native / Counter / inc.pm
CommitLineData
04e05413 1package Moose::Meta::Method::Accessor::Native::Counter::inc;
2
3use strict;
4use warnings;
5
8b9641b8 6use Moose::Role;
7
00bbc132 8with 'Moose::Meta::Method::Accessor::Native::Writer';
04e05413 9
10sub _minimum_arguments { 0 }
11sub _maximum_arguments { 1 }
12
13sub _potential_value {
53a4677c 14 my $self = shift;
15 my ($slot_access) = @_;
04e05413 16
1e2c801e 17 return $slot_access . ' + (defined $_[0] ? $_[0] : 1)';
04e05413 18}
19
a486d5ad 20sub _inline_optimized_set_new_value {
53a4677c 21 my $self = shift;
22 my ($inv, $new, $slot_access) = @_;
04e05413 23
a486d5ad 24 return $slot_access . ' += defined $_[0] ? $_[0] : 1;';
04e05413 25}
26
8b9641b8 27no Moose::Role;
28
04e05413 291;