On Fri, Apr 24, 2009 at 12:16 PM, Hans Dieter Pearcey <h...@pobox.com> wrote:
> See Moose::Exporter.  (MooseX::Attributes::Curried *almost* does this, but the
> predicate isn't currently possible using it; Sartak, any good ideas?)

This doesn't currently work, but 0.02 will have it:

    package YourApp::Attrs;
    use MooseX::Attributes::Curried (
        boolean_filter => sub {
              my $name = shift;
              return {
                  is => 'ro',
                  isa => 'Bool',
                  predicate => "has_$name",
              };
        },
    );

Shawn

Reply via email to