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