foo
[gitmo/Moose.git] / lib / Moose / Compiler / Perl6.pm
CommitLineData
4276ccb4 1
2package Moose::Compiler::Perl6;
3use Moose;
4
5our $VERSION = '0.01';
6
7with 'Moose::Compiler::Engine';
8
9sub compile_class {
10 my ($self, $meta) = @_;
11 my $o = '';
12 $o .= ('class ' . $meta->name . "-" . $meta->version . " {\n");
13 $o .= ("\n");
14 foreach my $attr_name ($meta->get_attribute_list) {
15 my $attr = $meta->get_attribute($attr_name);
16 my @options;
17 push @options => ("is " . $attr->_is_metadata . "")
18 if $attr->_is_metadata;
19 push @options => ("does " . $attr->_does_metadata . "")
20 if $attr->_does_metadata;
21 $o .= (" has " . ($attr->_isa_metadata ? ($attr->_isa_metadata . " ") : '')
22 . "\$" . $attr->name . " " . (join " " => @options) . ";\n");
23 }
24 $o .= ("\n");
25 $o .= ("}\n");
26 return $o;
27}
28
291;
30
31__END__
32
33=pod
34
35=head1 NAME
36
37Moose::Compiler::Perl6 - A Moose compiler engine for compiling to Perl 6
38
39=head1 DESCRIPTION
40
41=head1 METHODS
42
43=over 4
44
45=item B<meta>
46
47This will return the metaclass associated with the given role.
48
49=item B<compile_class>
50
51=back
52
53=head1 BUGS
54
55All complex software has bugs lurking in it, and this module is no
56exception. If you find a bug please either email me, or add the bug
57to cpan-RT.
58
59=head1 AUTHOR
60
61Stevan Little E<lt>stevan@iinteractive.comE<gt>
62
63=head1 COPYRIGHT AND LICENSE
64
65Copyright 2006 by Infinity Interactive, Inc.
66
67L<http://www.iinteractive.com>
68
69This library is free software; you can redistribute it and/or modify
70it under the same terms as Perl itself.
71
72=cut