GNU.WIKI: The GNU/Linux Knowledge Base

  [HOME] [PHP Manual] [HowTo] [ABS] [MAN1] [MAN2] [MAN3] [MAN4] [MAN5] [MAN6] [MAN7] [MAN8] [MAN9]

  [0-9] [Aa] [Bb] [Cc] [Dd] [Ee] [Ff] [Gg] [Hh] [Ii] [Jj] [Kk] [Ll] [Mm] [Nn] [Oo] [Pp] [Qq] [Rr] [Ss] [Tt] [Uu] [Vv] [Ww] [Xx] [Yy] [Zz]


NAME

       MooseX::AttributeTags - tag your Moose attributes

SYNOPSIS

          package User;

          use Moose;
          use MooseX::Types::Moose 'Bool';
          use MooseX::AttributeTraits (
             SerializationStyle => [
                hidden => Bool,
             ],
          );

          has username => (
             traits => [ SerializationStyle ],
             is     => 'ro',
             hidden => 0,
          );

          has password => (
             traits => [ SerializationStyle ],
             is     => 'rw',
             hidden => 1,
          );

DESCRIPTION

       MooseX::AttributeTags is a factory for attribute traits. All the work
       is done in the import method.

   Methods
       "import(@optlist)"
           The option list is a list of trait names to create (which will be
           exported to the caller package as constants).

           Each trait name may be optionally followed by an arrayref of
           attributes to be created within the trait. (In the SYNOPSIS, the
           "SerializationStyle" trait gets an attribute called "hidden".)

           Each attribute may be optionally followed by one of:

           ·   A coderef which provides a default value for the attribute.

           ·   A type constraint object (such as those provided by
               Types::Standard or MooseX::Types; not a type constraint string)
               to validate the attribute.

           ·   An arrayref or hashref providing options similar to those given
               to Moose's "has" keyword.

BUGS

       Please report any bugs to
       <http://rt.cpan.org/Dist/Display.php?Queue=MooseX-AttributeTags>.

SEE ALSO

       Moose.

AUTHOR

       Toby Inkster <tobyink@cpan.org>.

COPYRIGHT AND LICENCE

       This software is copyright (c) 2013 by Toby Inkster.

       This is free software; you can redistribute it and/or modify it under
       the same terms as the Perl 5 programming language system itself.

DISCLAIMER OF WARRANTIES

       THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED
       WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
       MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.



  All copyrights belong to their respective owners. Other content (c) 2014-2018, GNU.WIKI. Please report site errors to webmaster@gnu.wiki.
Page load time: 0.112 seconds. Last modified: November 04 2018 12:49:43.