Commit | Line | Data |
---|---|---|
f23ffd15 | 1 | package Moose::Meta::Method::Accessor::Native::Number::add; |
2 | ||
3 | use strict; | |
4 | use warnings; | |
5 | ||
8b9641b8 | 6 | use Moose::Role; |
7 | ||
00bbc132 | 8 | with 'Moose::Meta::Method::Accessor::Native::Writer'; |
f23ffd15 | 9 | |
1e2c801e | 10 | sub _minimum_arguments { 1 } |
8b9641b8 | 11 | |
1e2c801e | 12 | sub _maximum_arguments { 1 } |
f23ffd15 | 13 | |
14 | sub _potential_value { | |
53a4677c | 15 | my $self = shift; |
16 | my ($slot_access) = @_; | |
f23ffd15 | 17 | |
53a4677c | 18 | return $slot_access . ' + $_[0]'; |
f23ffd15 | 19 | } |
20 | ||
a486d5ad | 21 | sub _inline_optimized_set_new_value { |
53a4677c | 22 | my $self = shift; |
23 | my ($inv, $new, $slot_access) = @_; | |
f23ffd15 | 24 | |
a486d5ad | 25 | return $slot_access . ' += $_[0];'; |
f23ffd15 | 26 | } |
27 | ||
8b9641b8 | 28 | no Moose::Role; |
29 | ||
f23ffd15 | 30 | 1; |