Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
MooseX::MetaDescriptioUser Contributed Perl DocumentMooseX::MetaDescription(3)

NAME
       MooseX::MetaDescription - A framework for adding	additional metadata to
       Moose classes

SYNOPSIS
	 package Foo;
	 use metaclass 'MooseX::MetaDescription::Meta::Class' => (
	     # add class-level metadata
	     description => {
		 'Hello' => 'World'
	     }
	 );
	 use Moose;

	 has 'bar' => (
	     metaclass	 => 'MooseX::MetaDescription::Meta::Attribute',
	     is		 => 'ro',
	     isa	 => 'Str',
	     default	 => sub	{ Bar->new() },
	     # add attribute level metadata
	     description => {
		 node_type   =>	'element',
	     }
	 );

	 my $foo = Foo->new;

	 $foo->meta->description; # { 'Hello' => 'World' }

	 my $bar = $foo->meta->get_attribute('bar');

	 # access the desciption HASH directly
	 $bar->description; # {	node_type   => 'element' }

	 # or access the instance of MooseX::MetaDescription::Description
	 $bar->metadescription;

	 # access the original attribute metaobject from the metadesc too
	 $bar->metadescription->descriptor == $bar;

DESCRIPTION
       MooseX::MetaDescription allows you to add arbitrary out of band
       metadata	to your	Moose classes and attributes. This will	allow you to
       track out of band data along with attributes, which is very useful for
       say serializing Moose classes in	HTML or	XML.

METHODS
       meta
	   The Moose metaclass.

BUGS
       All complex software has	bugs lurking in	it, and	this module is no
       exception. If you find a	bug please either email	me, or add the bug to
       cpan-RT.

AUTHOR
       Code and	Design originally by Jonathan Rockway in the Ernst module,
       extracted and refactored	by:

       Stevan Little <stevan.little@iinteractive.com>

COPYRIGHT AND LICENSE
       Copyright 2008 Infinity Interactive, Inc.

       <http://www.iinteractive.com>

       This library is free software; you can redistribute it and/or modify it
       under the same terms as Perl itself.

perl v5.32.0			  2012-12-11	    MooseX::MetaDescription(3)

NAME | SYNOPSIS | DESCRIPTION | METHODS | BUGS | AUTHOR | COPYRIGHT AND LICENSE

Want to link to this manual page? Use this URL:
<https://www.freebsd.org/cgi/man.cgi?query=MooseX::MetaDescription&sektion=3&manpath=FreeBSD+12.2-RELEASE+and+Ports>

home | help