From: Jason May Date: Sat, 15 Nov 2008 04:00:30 +0000 (+0000) Subject: Bool metaclass now implies type Bool X-Git-Tag: 0.16~17 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=8ba9223461d20f3978f61c367b5fe57fa963e335;p=gitmo%2FMooseX-AttributeHelpers.git Bool metaclass now implies type Bool --- diff --git a/lib/MooseX/AttributeHelpers/Bool.pm b/lib/MooseX/AttributeHelpers/Bool.pm index e8910bc..fb324a2 100644 --- a/lib/MooseX/AttributeHelpers/Bool.pm +++ b/lib/MooseX/AttributeHelpers/Bool.pm @@ -19,7 +19,16 @@ sub helper_type { 'Bool' } has '+method_provider' => ( default => 'MooseX::AttributeHelpers::MethodProvider::Bool' ); - + +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; + } +}; + no Moose; # register the alias ...