.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.43) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Bread::Board::Types 3pm" .TH Bread::Board::Types 3pm "2022-12-12" "perl v5.36.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Bread::Board::Types \- types and coercions for Bread::Board .SH "VERSION" .IX Header "VERSION" version 0.37 .SH "DESCRIPTION" .IX Header "DESCRIPTION" This package defines types and coercions for Bread::Board. .SH "TYPES" .IX Header "TYPES" .ie n .SS """Bread::Board::Container::SubContainerList""" .el .SS "\f(CWBread::Board::Container::SubContainerList\fP" .IX Subsection "Bread::Board::Container::SubContainerList" A hashref mapping strings to instances of Bread::Board::Container or Bread::Board::Container::Parameterized. .PP Can be coerced from an arrayref of containers: the keys will be the containers' names. .ie n .SS """Bread::Board::Container::ServiceList""" .el .SS "\f(CWBread::Board::Container::ServiceList\fP" .IX Subsection "Bread::Board::Container::ServiceList" A hashref mapping strings to instances of Bread::Board::Service. .PP Can be coerced from an arrayref of services: the keys will be the services' names. .ie n .SS """Bread::Board::Service::Dependencies""" .el .SS "\f(CWBread::Board::Service::Dependencies\fP" .IX Subsection "Bread::Board::Service::Dependencies" Hashref mapping strings to instances of Bread::Board::Dependency. .PP The values of the hashref can be coerced in several different ways: .IP "a string" 4 .IX Item "a string" will be interpreted as the \f(CW\*(C`service_path\*(C'\fR .IP "a hashref with a single key" 4 .IX Item "a hashref with a single key" the key will be interpreted as a \f(CW\*(C`service_path\*(C'\fR, and the value as a hashref for \f(CW\*(C`service_params\*(C'\fR .IP "an arrayref" 4 .IX Item "an arrayref" each element will be interpreted as a dependency (possibly through all the coercions listed here); see below for an example .IP "a service object" 4 .IX Item "a service object" will be interpreted as a dependency on that service .IP "a dependency object" 4 .IX Item "a dependency object" will be taken as-is .PP Instead of a hashref of any of the above things, you can use an arrayref: it will be coerced to hashref, using the (coerced) dependencies' names as keys. .PP \fIExamples\fR .IX Subsection "Examples" .PP .Vb 6 \& service foo => ( \& class => \*(AqFoo\*(Aq, \& dependencies => { \& { bar => { attribute => 12 } }, \& }, \& ); .Ve .PP The service \f(CW\*(C`foo\*(C'\fR depends on the parameterized service \f(CW\*(C`bar\*(C'\fR, and \&\f(CW\*(C`bar\*(C'\fR will be instantiated passing the hashref \f(CW\*(C`{ attribute => 12 }\*(C'\fR to its \f(CW\*(C`get\*(C'\fR method. .PP .Vb 6 \& service foo => ( \& class => \*(AqFoo\*(Aq, \& dependencies => { \& things => [ \*(Aqbar\*(Aq, \*(Aqbaz\*(Aq ], \& }, \& ); .Ve .PP The service \f(CW\*(C`foo\*(C'\fR depends on the services \f(CW\*(C`bar\*(C'\fR and \f(CW\*(C`baz\*(C'\fR, and when instantiating \f(CW\*(C`foo\*(C'\fR, its constructor will receive something like \f(CW\*(C`things => [ $instance_of_bar, $instance_of_baz ]\*(C'\fR. .PP .Vb 9 \& service foo => ( \& class => \*(AqFoo\*(Aq, \& dependencies => { \& things => [ \& { bar => { attribute => 12 } }, \& { bar => { attribute => 27 } }, \& ], \& }, \& ); .Ve .PP You can mix&match the coercions! This \f(CW\*(C`foo\*(C'\fR will get two different instances of \f(CW\*(C`bar\*(C'\fR in its \f(CW\*(C`things\*(C'\fR attribute, each \f(CW\*(C`bar\*(C'\fR instantiated with a different value. .ie n .SS """Bread::Board::Service::Parameters""" .el .SS "\f(CWBread::Board::Service::Parameters\fP" .IX Subsection "Bread::Board::Service::Parameters" Hashref mapping strings to MooseX::Params::Validate specifications. .PP Can be coerced from an arrayref of strings: .PP .Vb 1 \& [qw(a b c)] .Ve .PP becomes: .PP .Vb 5 \& { \& a => { optional => 0 }, \& b => { optional => 0 }, \& c => { optional => 0 }, \& } .Ve .SH "AUTHOR" .IX Header "AUTHOR" Stevan Little .SH "BUGS" .IX Header "BUGS" Please report any bugs or feature requests on the bugtracker website https://github.com/stevan/BreadBoard/issues .PP When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature. .SH "COPYRIGHT AND LICENSE" .IX Header "COPYRIGHT AND LICENSE" This software is copyright (c) 2019, 2017, 2016, 2015, 2014, 2013, 2011, 2009 by Infinity Interactive. .PP This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.