GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
Bread::Board::Declare::Meta::Role::Attribute::Container(3) User Contributed Perl Documentation Bread::Board::Declare::Meta::Role::Attribute::Container(3)

Bread::Board::Declare::Meta::Role::Attribute::Container - attribute metarole for container attributes in Bread::Board::Declare

version 0.16

This attribute trait indicates that the attribute (in a Bread::Board::Declare class) contains a subcontainer rather than a service. It must be specified explicitly (or else a service that happens to return a container will be created):

  has attr => (
      traits => ['Container'],
      is     => 'ro',
      isa    => 'Bread::Board::Container',
  );

Container attributes (unlike service attributes) can have defaults and builders, allowing you to also define subcontainers inline when desired, as in:

  has attr => (
      traits  => ['Container'],
      is      => 'ro',
      isa     => 'Bread::Board::Container',
      default => sub {
          container Foo => as {
              service Bar => 'BAR';
          };
      }
  );

If no default or builder is supplied, the type constraint will be used to create a container instance automatically (using a temporary ConstructorInjection service). This is the dependency specification to use for that temporary service.

Jesse Luehrs <doy@tozt.net>

This software is Copyright (c) 2014 by Jesse Luehrs.

This is free software, licensed under:

  The MIT (X11) License
2014-02-25 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.