X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FMoose%2FMeta%2FMethod%2FAccessor%2FNative%2FString%2Fchomp.pm;h=160970250c5cf86dbb6206639445a820deefb74f;hb=11e5616558da8cea18510f2f194946262f1d8477;hp=92495ddbcd2a08f53f0ebf9aa884f3fab60e2896;hpb=10bd99ecf3f1706d4452fa57e3f08a63b9f92a11;p=gitmo%2FMoose.git diff --git a/lib/Moose/Meta/Method/Accessor/Native/String/chomp.pm b/lib/Moose/Meta/Method/Accessor/Native/String/chomp.pm index 92495dd..1609702 100644 --- a/lib/Moose/Meta/Method/Accessor/Native/String/chomp.pm +++ b/lib/Moose/Meta/Method/Accessor/Native/String/chomp.pm @@ -3,25 +3,42 @@ package Moose::Meta::Method::Accessor::Native::String::chomp; use strict; use warnings; -our $VERSION = '1.14'; +our $VERSION = '1.24'; $VERSION = eval $VERSION; our $AUTHORITY = 'cpan:STEVAN'; -use base 'Moose::Meta::Method::Accessor::Native::Writer'; +use Moose::Role; -sub _minimum_arguments { 0 } -sub _maximum_arguments { 0 } +with 'Moose::Meta::Method::Accessor::Native::Writer' => { + -excludes => [ + qw( + _maximum_arguments + _inline_optimized_set_new_value + _return_value + ) + ] +}; + +sub _maximum_arguments {0} sub _potential_value { my ( $self, $slot_access ) = @_; - return "( do { my \$val = $slot_access; chomp \$val; \$val } )"; + return "( do { my \$val = $slot_access; \@return = chomp \$val; \$val } )"; } sub _inline_optimized_set_new_value { my ( $self, $inv, $new, $slot_access ) = @_; - return "chomp $slot_access;"; + return "\@return = chomp $slot_access"; +} + +sub _return_value { + my ( $self, $slot_access ) = @_; + + return '$return[0]'; } +no Moose::Role; + 1;