On Tue, Jun 15, 2010 at 7:17 PM, Stephen Prytherch
<sprythe...@mywebgrocer.com> wrote:
> Hello,
> I have small problem. I define a class 'Node' with 2 enums Action and State
> and when creating an instance it enforces constraints correctly. However
> once I’ve created an instance it doesn’t seem to enforce constraints.
>
> ...
>
> $btn->{Type}='An Illegal Value';

This skips the accessor that you setup, bypassing Moose entirely. You
should be doing:

$btn->Type('An Illegal Value');

However, you've also marked Type as being read-only, which means you
can't change it's value at all (other than during construction).

-- 
    Oliver Charles / aCiD2

Reply via email to