From: Shawn M Moore Date: Sun, 21 Oct 2007 00:37:24 +0000 (+0000) Subject: Use get_attribute('x') instead of get_attribute_map->{'x'} X-Git-Tag: 0_27~17 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=376a56f70358287eb0d397f29a0a9dab5a0725ff;p=gitmo%2FMoose.git Use get_attribute('x') instead of get_attribute_map->{'x'} --- diff --git a/lib/Moose/Cookbook/Recipe11.pod b/lib/Moose/Cookbook/Recipe11.pod index 1388199..e4cd60f 100644 --- a/lib/Moose/Cookbook/Recipe11.pod +++ b/lib/Moose/Cookbook/Recipe11.pod @@ -105,11 +105,12 @@ looks like the following: y => Moose::Meta::Attribute=HASH(0x18d1690), } -Here's one thing you can do now that you can interact with the attribute's -object directly: +Another way to get a handle on an attribute's object is +C<< $self->meta->get_attribute('name') >>. Here's one thing you can do now that +you can interact with the attribute's object directly: - print $point->meta->get_attribute_map->{x}->type_constraint; - => Int + print $point->meta->get_attribute('x')->type_constraint; + => Int (As an aside, it's not called C<< ->isa >> because C<< $obj->isa >> is already taken)