X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FMooseX%2FMetaDescription%2FMeta%2FClass.pm;fp=lib%2FMooseX%2FMetaDescription%2FMeta%2FClass.pm;h=5d1e2cccfd2b86c987ed4908e8b75bd722faef98;hb=56e78a9caff840fb68085ead8837a64c839740de;hp=80fedfed40cf11781f690dc01d887058d81fc76e;hpb=d9f5e5aeb1ca767b140e316900b53cfc4e87a09e;p=gitmo%2FMooseX-MetaDescription.git diff --git a/lib/MooseX/MetaDescription/Meta/Class.pm b/lib/MooseX/MetaDescription/Meta/Class.pm index 80fedfe..5d1e2cc 100644 --- a/lib/MooseX/MetaDescription/Meta/Class.pm +++ b/lib/MooseX/MetaDescription/Meta/Class.pm @@ -32,10 +32,70 @@ __END__ MooseX::MetaDescription::Meta::Class - Custom class metaclass for meta-descriptions +=head1 SYNOPSIS + + package Foo; + use metaclass 'MooseX::MetaDescription::Meta::Class' => ( + description => { + 'Hello' => 'World', + } + ); + use Moose; + + package Bar; + use Moose; + + extends 'Foo'; + + # always add it *after* the extends + __PACKAGE__->meta->description->{'Hello'} = 'Earth'; + + package Baz; + use Moose; + + extends 'Bar'; + + package Gorch; + use metaclass 'MooseX::MetaDescription::Meta::Class' => ( + description => { + 'Hello' => 'World' + } + ); + use Moose; + + extends 'Baz'; + + # ... + + Foo->meta->description # { 'Hello' => 'World', 'World' => 'Hello' } + Bar->meta->description # { 'Hello' => 'Earth', 'World' => 'Hello' } # change one, inherit the other + Baz->meta->description # { 'Hello' => 'Earth', 'World' => 'Hello' } # inherit both + Gorch->meta->description # { 'Hello' => 'World' } # overrides all, no inheritance + =head1 DESCRIPTION -Nothing worth saying yet actually, mostly internal usage only. See the -SYNPOSIS in L for an example of usage. +This module provides the custom metaclass to add Meta Descriptions +to your classes. It provides a limited degree of inheritance of +meta-descriptions, the details of which are shown above in the +SYNOPSIS section. + +=head1 METHODS + +NOTE: these are methods composed into this class from +L refer to that +module for the complete description. + +=over 4 + +=item B + +=item B + +=item B + +=item B + +=back =head1 BUGS