SQL::Translator::Role::ListAttr - context-sensitive list attributes
package Foo; use Moo; use SQL::Translator::Role::ListAttr; with ListAttr foo => ( uniq => 1, append => 1 );
This package provides a variable Moo::Role for context-sensitive list attributes.
Returns a Moo::Role providing an arrayref attribute named $name, and wrapping the accessor to provide context-sensitivity both for setting and getting. If no builder or default is provided, the default value is the empty list.
$name
builder
default
On setting, the arguments are parsed using "parse_list_arg" in SQL::Translator::Utils, and the accessor will return an array reference or a list, depending on context.
If true, the setter will append arguments to the existing ones, rather than replacing them.
If true, duplicate items will be removed, keeping the first one seen.
If accessing the attribute might throw an exception (e.g. from a builder or isa check), this should be set to make the accessor store the exception using SQL::Translator::Role::Error and return undef.
isa
If true, and the list is empty, the accessor will return undef instead of a reference to an empty in scalar context.
undef
Unknown parameters are passed through to the has call for the attribute.
To install SQL::Translator, copy and paste the appropriate command in to your terminal.
cpanm
cpanm SQL::Translator
CPAN shell
perl -MCPAN -e shell install SQL::Translator
For more information on module installation, please visit the detailed CPAN module installation guide.