2 use lib '/Users/stevan/CPAN/Class-MOP/Class-MOP/lib';
11 use Scalar::Util 'blessed';
14 use Moose::Meta::Class;
15 use Moose::Meta::Attribute;
24 if ($pkg->can('meta')) {
26 (blessed($meta) && $meta->isa('Class::MOP::Class'))
27 || confess "Whoops, not møøsey enough";
30 $meta = Moose::Meta::Class->initialize($pkg => (
31 ':attribute_metaclass' => 'Moose::Meta::Attribute'
36 $meta->alias_method('has' => sub { $meta->add_attribute(@_) });
38 # handle method modifers
39 $meta->alias_method('before' => sub {
41 $meta->add_before_method_modifier($_, $code) for @_;
43 $meta->alias_method('after' => sub {
45 $meta->add_after_method_modifier($_, $code) for @_;
47 $meta->alias_method('around' => sub {
49 $meta->add_around_method_modifier($_, $code) for @_;
52 # make sure they inherit from Moose::Object
53 $meta->superclasses('Moose::Object')
54 unless $meta->superclasses();
56 # we recommend using these things
57 # so export them for them
58 $meta->alias_method('confess' => \&confess);
59 $meta->alias_method('blessed' => \&blessed);
77 has '$.x' => (reader => 'x');
78 has '$.y' => (accessor => 'y');
93 after 'clear' => sub {
102 Makes Other Object Systems Envious
104 Most Other Objects Suck Eggs
106 Makes Object Orientation So Easy
108 Metacircular Object Oriented Systems Environment
112 All complex software has bugs lurking in it, and this module is no
113 exception. If you find a bug please either email me, or add the bug
118 I use L<Devel::Cover> to test the code coverage of my tests, below is the
119 L<Devel::Cover> report on this module's test suite.
121 =head1 ACKNOWLEDGEMENTS
125 Stevan Little E<lt>stevan@iinteractive.comE<gt>
127 =head1 COPYRIGHT AND LICENSE
129 Copyright 2006 by Infinity Interactive, Inc.
131 L<http://www.iinteractive.com>
133 This library is free software; you can redistribute it and/or modify
134 it under the same terms as Perl itself.