in reply to Introspection of Moose/Mouse attributes fails to find native trait with `does`
package MyCow; use Moose; has 'guernsey' => ( traits => ['Bool'], 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('Bool'); print "Attribute does Boolean? ", $cow->guernsey ? "Yes!" : "No...", $ +/;
|
---|