2 package Moose::Compiler::Moose;
7 with 'Moose::Compiler::Engine';
10 my ($self, $meta) = @_;
12 $o .= ('package ' . $meta->name . ";\n");
13 $o .= ("use Moose;\n");
15 $o .= ("our \$VERSION = '" . $meta->version . "';\n");
17 foreach my $attr_name ($meta->get_attribute_list) {
18 my $attr = $meta->get_attribute($attr_name);
20 push @options => ("is => '" . $attr->_is_metadata . "'")
21 if $attr->_is_metadata;
22 push @options => ("isa => '" . $attr->_isa_metadata . "'")
23 if $attr->_isa_metadata;
24 push @options => ("does => '" . $attr->_does_metadata . "'")
25 if $attr->_does_metadata;
26 $o .= ("has '" . $attr->name . "' => (" . (join ", " => @options) . ");\n");
43 Moose::Compiler::Moose - A Moose compiler engine for compiling to Moose
53 This will return the metaclass associated with the given role.
55 =item B<compile_class>
61 All complex software has bugs lurking in it, and this module is no
62 exception. If you find a bug please either email me, or add the bug
67 Stevan Little E<lt>stevan@iinteractive.comE<gt>
69 =head1 COPYRIGHT AND LICENSE
71 Copyright 2006 by Infinity Interactive, Inc.
73 L<http://www.iinteractive.com>
75 This library is free software; you can redistribute it and/or modify
76 it under the same terms as Perl itself.