23 Oct 2016 01:05:59 UTC
- Distribution: MooseX-UndefTolerant
- Module version: 0.21
- Source (raw)
- Browse (raw)
- How to Contribute
- Issues (1)
- Testers (1991 / 21 / 0)
- KwaliteeBus factor: 2
- 99.03% Coverage
- License: perl_5
- Perl: v5.6.0
- Activity24 month
- Download (32.85KB)
- MetaCPAN Explorer
- Subscribe to distribution
- This version
- Latest version++ed by:4 non-PAUSE usersETHER Karen Etheridge 🐾 🌋🦑🇹🇼🇭🇰🇺🇦
MooseX::UndefTolerant::Attribute - Make your attribute(s) tolerant to undef initialization
package My:Class; use Moose; use MooseX::UndefTolerant::Attribute; has 'bar' => ( traits => [ qw(MooseX::UndefTolerant::Attribute)], is => 'ro', isa => 'Num', predicate => 'has_bar' ); # Meanwhile, under the city... # Doesn't explode my $class = My::Class->new(bar => undef); $class->has_bar # False!
Applying this trait to your attribute makes its initialization tolerant of of undef. If you specify the value of undef to any of the attributes they will not be initialized (or will be set to the default, if applicable). Effectively behaving as if you had not provided a value at all.
There is also a mailing list available for users of this distribution, at http://lists.perl.org/list/moose.html.
There is also an irc channel available for users of this distribution, at
Cory G Watson <gphat at cpan.org>
This software is copyright (c) 2011 by Cory G Watson.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
Module Install Instructions
To install MooseX::UndefTolerant, copy and paste the appropriate command in to your terminal.
perl -MCPAN -e shell install MooseX::UndefTolerant
For more information on module installation, please visit the detailed CPAN module installation guide.