in reply to Re^2: Moose: mutualy exclusive bolean attributes.
in thread Moose: mutualy exclusive bolean attributes.

Thank you. ikegami

That looks like it handles the requirement for a getter for the success|error|pending attributes. I guess if I want a setter as well, I can expand those subs to larger ones that read the value of $_[1] as well.

Combined with Arunbear's suggestion to use Moose::Util::TypeConstraints to get an enum on the underlying status field, I think I am three quarters of the way to what I want to achieve.

Replies are listed 'Best First'.
Re^4: Moose: mutualy exclusive bolean attributes.
by ikegami (Patriarch) on Dec 24, 2010 at 17:53 UTC

    I guess if I want a setter as well, I can expand those subs to larger ones that read the value of $_[1] as well.

    That doesn't make much sense. What would happen for

    $self->error(0);

      Change the status to undefined, but it would be better to do $self->pending(1)

        The point was that always expecting the same value for an argument is weird. It could point to a design weakness.