1 package MooseX::MetaDescription;
5 our $AUTHORITY = 'cpan:STEVAN';
7 use MooseX::MetaDescription::Meta::Class;
8 use MooseX::MetaDescription::Meta::Attribute;
9 use MooseX::MetaDescription::Description;
19 MooseX::MetaDescription - A framework for adding additional metadata to Moose classes
24 use metaclass 'MooseX::MetaDescription::Meta::Class' => (
25 # add class-level metadata
33 metaclass => 'MooseX::MetaDescription::Meta::Attribute',
36 default => sub { Bar->new() },
37 # add attribute level metadata
39 node_type => 'element',
45 $foo->meta->description; # { 'Hello' => 'World' }
47 my $bar = $foo->meta->get_attribute('bar');
49 # access the desciption HASH directly
50 $bar->description; # { node_type => 'element' }
52 # or access the instance of MooseX::MetaDescription::Description
53 $bar->metadescription;
55 # access the original attribute metaobject from the metadesc too
56 $bar->metadescription->descriptor == $bar;
60 MooseX::MetaDescription allows you to add arbitrary out of band
61 metadata to your Moose classes and attributes. This will allow
62 you to track out of band data along with attributes, which is
63 very useful for say serializing Moose classes in HTML or XML.
77 All complex software has bugs lurking in it, and this module is no
78 exception. If you find a bug please either email me, or add the bug
83 Code and Design originally by Jonathan Rockway in the Ernst module,
84 extracted and refactored by:
86 Stevan Little E<lt>stevan.little@iinteractive.comE<gt>
88 =head1 COPYRIGHT AND LICENSE
90 Copyright 2008 Infinity Interactive, Inc.
92 L<http://www.iinteractive.com>
94 This library is free software; you can redistribute it and/or modify
95 it under the same terms as Perl itself.