From: Chris Prather Date: Tue, 29 Apr 2008 19:03:08 +0000 (+0000) Subject: Add a Synopsis based on the tests X-Git-Tag: 0.04~28 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=17f25b49d8e015f6283c9f7f8b0bc579f06d79f8;p=gitmo%2FMooseX-MetaDescription.git Add a Synopsis based on the tests --- diff --git a/lib/MooseX/MetaDescription.pm b/lib/MooseX/MetaDescription.pm index b4e681d..c848df4 100644 --- a/lib/MooseX/MetaDescription.pm +++ b/lib/MooseX/MetaDescription.pm @@ -20,7 +20,26 @@ MooseX::MetaDescription - A framework for adding additional metadata to Moose cl =head1 SYNOPSIS - use MooseX::MetaDescription; + package Foo; + use metaclass 'MooseX::MetaDescription::Meta::Class'; + use Moose; + + __PACKAGE__->meta->description->{'Hello'} = 'World'; + + has 'bar' => ( + metaclass => 'MooseX::MetaDescription::Meta::Attribute', + is => 'ro', + isa => 'Str', + default => sub { 'Foo::bar' }, + description => { + baz => 'Foo::bar::baz', + } + ); + + ... + + $foo->meta->description; # { 'Hello' => 'World' } + $foo->meta->get_attribute('bar')->description; # { baz => 'Foo::bar::baz' } =head1 DESCRIPTION