Bump version to 1.9900 for new version numbering scheme
[gitmo/Moose.git] / lib / Moose / Meta / Method / Accessor / Native / String / chomp.pm
CommitLineData
e7724627 1package Moose::Meta::Method::Accessor::Native::String::chomp;
2
3use strict;
4use warnings;
5
bb8ef151 6our $VERSION = '1.9900';
e7724627 7$VERSION = eval $VERSION;
8our $AUTHORITY = 'cpan:STEVAN';
9
8b9641b8 10use Moose::Role;
11
12with 'Moose::Meta::Method::Accessor::Native::Writer' => {
13 -excludes => [
14 qw(
15 _maximum_arguments
a486d5ad 16 _inline_optimized_set_new_value
7f5ec80d 17 _return_value
8b9641b8 18 )
19 ]
20};
e7724627 21
1e2c801e 22sub _maximum_arguments { 0 }
e7724627 23
24sub _potential_value {
53a4677c 25 my $self = shift;
26 my ($slot_access) = @_;
27
28 return '(do { '
29 . 'my $val = ' . $slot_access . '; '
30 . '@return = chomp $val; '
31 . '$val '
32 . '})';
e7724627 33}
34
a486d5ad 35sub _inline_optimized_set_new_value {
53a4677c 36 my $self = shift;
37 my ($inv, $new, $slot_access) = @_;
e7724627 38
a486d5ad 39 return '@return = chomp ' . $slot_access . ';';
7f5ec80d 40}
41
42sub _return_value {
53a4677c 43 my $self = shift;
44 my ($slot_access) = @_;
7f5ec80d 45
46 return '$return[0]';
e7724627 47}
48
8b9641b8 49no Moose::Role;
50
e7724627 511;