diff options
Diffstat (limited to 'lib/MooseX/Bread/Board/Meta/Role/Attribute.pm')
-rw-r--r-- | lib/MooseX/Bread/Board/Meta/Role/Attribute.pm | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/MooseX/Bread/Board/Meta/Role/Attribute.pm b/lib/MooseX/Bread/Board/Meta/Role/Attribute.pm index 52e5a7c..2622e84 100644 --- a/lib/MooseX/Bread/Board/Meta/Role/Attribute.pm +++ b/lib/MooseX/Bread/Board/Meta/Role/Attribute.pm @@ -48,14 +48,17 @@ has constructor_name => ( predicate => 'has_constructor_name', ); +has associated_service => ( + is => 'rw', + isa => 'Bread::Board::Service', + predicate => 'has_associated_service', +); + after attach_to_class => sub { my $self = shift; return unless $self->service; - my $meta = $self->associated_class; - my $attr_reader = $self->get_read_method; - my %params = ( associated_attribute => $self, name => $self->name, @@ -93,7 +96,7 @@ after attach_to_class => sub { } } - $meta->add_service($service) if $service; + $self->associated_service($service) if $service; }; after _process_options => sub { |