X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FMooseX%2FAttributeHelpers%2FString.pm;h=366c74c06e53757c7c41636ec93b599672d1f8d8;hb=f578a2164e6d761dee21133f26b8b039d5bf92ec;hp=6b31ffe132ac73b52f42651a39421ca4bf5b0e10;hpb=227feec855064b6c4f662df68870f76b4803fc68;p=gitmo%2FMooseX-AttributeHelpers.git diff --git a/lib/MooseX/AttributeHelpers/String.pm b/lib/MooseX/AttributeHelpers/String.pm index 6b31ffe..366c74c 100644 --- a/lib/MooseX/AttributeHelpers/String.pm +++ b/lib/MooseX/AttributeHelpers/String.pm @@ -2,45 +2,12 @@ package MooseX::AttributeHelpers::String; use Moose; -our $VERSION = '0.16'; +our $VERSION = '0.17'; $VERSION = eval $VERSION; our $AUTHORITY = 'cpan:STEVAN'; -use MooseX::AttributeHelpers::MethodProvider::String; - -extends 'MooseX::AttributeHelpers::Base'; - -has '+method_provider' => ( - default => 'MooseX::AttributeHelpers::MethodProvider::String' -); - -sub helper_type { 'Str' } - -before 'process_options_for_provides' => sub { - my ($self, $options, $name) = @_; - - # Set some default attribute options here unless already defined - if ((my $type = $self->helper_type) && !exists $options->{isa}){ - $options->{isa} = $type; - } - - $options->{is} = 'rw' unless exists $options->{is}; - $options->{default} = '' unless exists $options->{default}; -}; - -after 'check_provides_values' => sub { - my $self = shift; - my $provides = $self->provides; - - unless (scalar keys %$provides) { - my $method_constructors = $self->method_constructors; - my $attr_name = $self->name; - - foreach my $method (keys %$method_constructors) { - $provides->{$method} = ($method . '_' . $attr_name); - } - } -}; +extends 'Moose::Meta::Attribute'; +with 'MooseX::AttributeHelpers::Trait::String'; no Moose;