Toby Inkster > MooseX-FunkyAttributes > MooseX::FunkyAttributes::Role::Attribute::InsideOut

Download:
MooseX-FunkyAttributes-0.003.tar.gz

Dependencies

Annotate this POD

Website

CPAN RT

Open  0
View/Report Bugs
Module Version: 0.003   Source  

NAME ^

MooseX::FunkyAttributes::Role::Attribute::InsideOut - an inside-out attribute

SYNOPSIS ^

   package Person;
   
   use Moose;
   use MooseX::FunkyAttributes;
   
   has name => (
      traits => [ InsideOutAttribute ],
      is     => 'ro',
      isa    => 'Str',
   );
   
   has age => (
      is     => 'ro',
      isa    => 'Num',
   );
   
   package main;
   
   use feature 'say';
   
   my $bob = Person->new(name => 'Bob', age => 32);
   say $bob->name;   # Bob
   say $bob->dump;   # $VAR1 = bless({ age => 32 }, 'Person');

DESCRIPTION ^

This trait implements the "inside-out" technique for Moose attributes. Unlike MooseX::InsideOut it doesn't make all attributes in the class inside-out; just the attribute(s) it is applied to.

One situation where you might want to do this is to hide certain attributes from dumps. For example, a "password" attribute that you don't want to appear in log files, or an attribute which contains a large chunk of textual data or a deeply nested data structure which makes the logs less readable.

This trait inherits from MooseX::FunkyAttributes::Role::Attribute, but forget about most of what you read in the documentaton for that trait. Those custom_set, custom_get, custom_inline_set, etc options are all automatically generated for you.

BUGS ^

Please report any bugs to http://rt.cpan.org/Dist/Display.html?Queue=MooseX-FunkyAttributes.

SEE ALSO ^

MooseX::FunkyAttributes, MooseX::InsideOut, Hash::FieldHash.

AUTHOR ^

Toby Inkster <tobyink@cpan.org>.

COPYRIGHT AND LICENCE ^

This software is copyright (c) 2012-2014 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.

syntax highlighting: