| Bread-Board documentation | Contained in the Bread-Board distribution. |
Bread::Board::Dependency
All complex software has bugs lurking in it, and this module is no exception. If you find a bug please either email me, or add the bug to cpan-RT.
Stevan Little <stevan@iinteractive.com>
Copyright 2007-2011 by Infinity Interactive, Inc.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
| Bread-Board documentation | Contained in the Bread-Board distribution. |
package Bread::Board::Dependency; use Moose; use Bread::Board::Service; our $VERSION = '0.20'; our $AUTHORITY = 'cpan:STEVAN'; with 'Bread::Board::Traversable'; has 'service_path' => ( is => 'ro', isa => 'Str', predicate => 'has_service_path' ); has 'service_name' => ( is => 'ro', isa => 'Str', lazy => 1, default => sub { my $self = shift; ($self->has_service_path) || confess "Could not determine service name without service path"; (split '/' => $self->service_path)[-1]; } ); has 'service_params' => ( is => 'ro', isa => 'HashRef', predicate => 'has_service_params' ); has 'service' => ( is => 'ro', does => 'Bread::Board::Service | Bread::Board::Dependency', lazy => 1, default => sub { my $self = shift; ($self->has_service_path) || confess "Could not fetch service without service path"; $self->fetch($self->service_path); }, handles => [ 'get', 'is_locked', 'lock', 'unlock' ] ); __PACKAGE__->meta->make_immutable; no Moose; 1; __END__