X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FMooseX%2FAttributeHelpers%2FString.pm;h=52e63238e2a07a0c7cee4ac0af5098472f4ff02d;hb=3ebd23e61a6d6f3c4dbda39e3b9d90c0b34d52c5;hp=fc1e2d313f4af2b32d378e223c1a23c1abed75e5;hpb=18d43c2c0d8aca2fd61b44cfc0a041788616895f;p=gitmo%2FMooseX-AttributeHelpers.git diff --git a/lib/MooseX/AttributeHelpers/String.pm b/lib/MooseX/AttributeHelpers/String.pm index fc1e2d3..52e6323 100644 --- a/lib/MooseX/AttributeHelpers/String.pm +++ b/lib/MooseX/AttributeHelpers/String.pm @@ -2,44 +2,12 @@ package MooseX::AttributeHelpers::String; use Moose; -our $VERSION = '0.13'; +our $VERSION = '0.22'; +$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; @@ -173,7 +141,7 @@ Stevan Little Estevan@iinteractive.comE =head1 COPYRIGHT AND LICENSE -Copyright 2007-2008 by Infinity Interactive, Inc. +Copyright 2007-2009 by Infinity Interactive, Inc. L