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
SQL::Translator::Role::ListAttr(3) User Contributed Perl Documentation SQL::Translator::Role::ListAttr(3)

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.

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.

Parameters

append
If true, the setter will append arguments to the existing ones, rather than replacing them.
uniq
If true, duplicate items will be removed, keeping the first one seen.
may_throw
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.
undef_if_empty
If true, and the list is empty, the accessor will return "undef" instead of a reference to an empty in scalar context.

Unknown parameters are passed through to the has call for the attribute.

SQL::Translator::Utils
SQL::Translator::Role::Error
2018-06-13 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.