Beginning of dzilization
[gitmo/Moose.git] / lib / Moose / Meta / Method / Accessor / Native / Number / abs.pm
1 package Moose::Meta::Method::Accessor::Native::Number::abs;
2
3 use strict;
4 use warnings;
5
6 our $AUTHORITY = 'cpan:STEVAN';
7
8 use Moose::Role;
9
10 with 'Moose::Meta::Method::Accessor::Native::Writer' => {
11     -excludes => [
12         qw(
13             _maximum_arguments
14             _inline_optimized_set_new_value
15             )
16     ]
17     };
18
19 sub _maximum_arguments { 0 }
20
21 sub _potential_value {
22     my $self = shift;
23     my ($slot_access) = @_;
24
25     return 'abs(' . $slot_access . ')';
26 }
27
28 sub _inline_optimized_set_new_value {
29     my $self = shift;
30     my ($inv, $new, $slot_access) = @_;
31
32     return $slot_access . ' = abs(' . $slot_access . ');';
33 }
34
35 no Moose::Role;
36
37 1;