NAME

MooseX::Attribute::Consumer - borrow and extend attributes from (other) Moose::Roles

VERSION

Version 0.01

CAVEAT

This is still an experimental module and should not be used in production systems. It is very, very likely to change when vetted against members of #Moose and moose@perl.org. The parts that may change are:

SYNOPSIS

	package MyRole;
	use Moose;
	use MooseX::Attribute::Consumer; # Now go get them
 	use MooseX::Attribute;

		attribute infile => ( 
			from_role => 'MyRole' ,
			prototype => 'file' 
			required  => 1
		);

		...

	package main;

		MyApp->new( infile => '/tmp/data' );

 

DESCRIPTION

MooseX::Attribute::Consumer is the class that allows for a class to import and extend prexisitng Moose attributes have been defined in Moose roles. attribute is used instead of has and the attribute options from_role and prototype are used to identify which role and which attribute to use as a prototype.

Details are in MooseX::Attribute

HOW IT WORKS

attribute delays the building of attributes. Instead, it keeps a list of attribute_prototypes and attribute_installs. A method modifier is then used to define these attribute prior to the class being initialized. This is similar to how roles are dealt with. In fact, although not done in this module, it would allow you to create methods that could apply options to all attributes in a single method call. At present, I do not believe this is (easily) possible.

LIMITATIONS

At present, simultaneously consuming an attribute from a role and using it as a prototype cannot work. The straight consumption will be overlooked. If you use an attribute as a prototype, all uses of that attribute must follow the prototype specification.

SEE ALSO

MooseX::Attribute Module for roles that provide attributes.

AUTHOR

Christopher Brown, <ctbrown at cpan.org>

BUGS

Please report any bugs or feature requests to bug-moosex-attribute at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=MooseX-Attribute. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

SUPPORT

You can find documentation for this module with the perldoc command.

perldoc MooseX::Attribute

You can also look for information at:

ACKNOWLEDGEMENTS

Though they would probably cringe to hear it, this effort would not have been possible without:

Shawn Moore

David Rolsky

Thomas Doran

Stevan Little

COPYRIGHT & LICENSE

Copyright 2008 Open Data Group, all rights reserved.

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