Commit | Line | Data |
---|---|---|
04e05413 | 1 | package Moose::Meta::Method::Accessor::Native::Counter::inc; |
2 | ||
3 | use strict; | |
4 | use warnings; | |
5 | ||
8b9641b8 | 6 | use Moose::Role; |
7 | ||
00bbc132 | 8 | with 'Moose::Meta::Method::Accessor::Native::Writer'; |
04e05413 | 9 | |
10 | sub _minimum_arguments { 0 } | |
11 | sub _maximum_arguments { 1 } | |
12 | ||
13 | sub _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 | 20 | sub _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 | 27 | no Moose::Role; |
28 | ||
04e05413 | 29 | 1; |