Your Mother has asked for the wisdom of the Perl Monks concerning the following question:
As I read the docs, the following code should report that the attribute does, Yes!, do Bool, instead of the No... it gives.
BEGIN { package MyCow; use Moose; # or Mouse has "guernsey" => is => "rw", isa => "Bool", ; } my $cow = MyCow->new; $cow->guernsey(1); print "How now, ", $cow->guernsey ? "brown" : "purple", " cow?", $/; my $attr = $cow->meta->get_attribute("guernsey"); print "Attribute does Bool? ", $attr->does("Bool") ? "Yes!" : "No...", + $/;
Do I just misunderstand? What is the right way to do this? I tried all the various names of the trait, like Moose::Meta::Attribute::Native::Trait::Bool.
|
---|