-
Notifications
You must be signed in to change notification settings - Fork 0
sartak/MooseX-DeclinableBuilder
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
NAME MooseX::DeclinableBuilder - let your builders decline to return a value SYNOPSIS has attr => ( traits => ['DeclinableBuilder'], is => 'ro', builder => '_build_attr', predicate => 'has_attr', ); sub _build_attr { my ($self, $no_value) = @_; return $no_value if rand() < .333; return undef if rand() < .5; return "ok"; } DESCRIPTION Sometimes, you just need your builders to elect to return no value. This is distinct from returning "undef" or false, especially since predicate treats a value of "undef" as having a value. This is very similar to MooseX::UndefTolerant except this module only modifies how builders work, and this module keeps "undef" as a distinct, usable value. AUTHOR Shawn M Moore "sartak@gmail.com" COPYRIGHT Copyright 2011 Shawn M Moore. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
About
let your builders decline to return a value
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published