Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

let your builders decline to return a value

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 lib
Octocat-spinner-32 t
Octocat-spinner-32 .gitignore
Octocat-spinner-32 Makefile.PL
Octocat-spinner-32 README
README
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.

Something went wrong with that request. Please try again.