Commit | Line | Data |
---|---|---|
f23ffd15 | 1 | package Moose::Meta::Method::Accessor::Native::Number::mod; |
2 | ||
3 | use strict; | |
4 | use warnings; | |
5 | ||
f23ffd15 | 6 | our $AUTHORITY = 'cpan:STEVAN'; |
7 | ||
8b9641b8 | 8 | use Moose::Role; |
9 | ||
10 | with 'Moose::Meta::Method::Accessor::Native::Writer' => { | |
11 | -excludes => [ | |
12 | qw( | |
13 | _minimum_arguments | |
14 | _maximum_arguments | |
a486d5ad | 15 | _inline_optimized_set_new_value |
8b9641b8 | 16 | ) |
17 | ] | |
7f5ec80d | 18 | }; |
f23ffd15 | 19 | |
1e2c801e | 20 | sub _minimum_arguments { 1 } |
8b9641b8 | 21 | |
1e2c801e | 22 | sub _maximum_arguments { 1 } |
f23ffd15 | 23 | |
24 | sub _potential_value { | |
53a4677c | 25 | my $self = shift; |
26 | my ($slot_access) = @_; | |
f23ffd15 | 27 | |
53a4677c | 28 | return $slot_access . ' % $_[0]'; |
f23ffd15 | 29 | } |
30 | ||
a486d5ad | 31 | sub _inline_optimized_set_new_value { |
53a4677c | 32 | my $self = shift; |
33 | my ($inv, $new, $slot_access) = @_; | |
f23ffd15 | 34 | |
a486d5ad | 35 | return $slot_access . ' %= $_[0];'; |
f23ffd15 | 36 | } |
37 | ||
8b9641b8 | 38 | no Moose::Role; |
39 | ||
f23ffd15 | 40 | 1; |