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