Revision history for MooseX-InsideOut
+0.002 Wed, 30 Jan 2008 17:40:32 -0500
+
+ * get rid of the 'extends' interface, emulate MooseX::StrictConstructor
+
0.001 Thu, 24 Jan 2008 13:17:54 -0500
* first release; thanks to stevan and mst for help
package MooseX::InsideOut;
-use metaclass 'MooseX::InsideOut::Meta::Class';
-use Moose;
+use MooseX::InsideOut::Meta::Class;
+BEGIN { require Moose }
+use Carp;
-our $VERSION = '0.001';
+our $VERSION = '0.002';
+
+sub import {
+ my $class = shift;
+
+ if (@_) { Carp::confess "$class has no exports" }
+
+ my $into = caller;
+
+ return if $into eq 'main';
+
+ Moose::init_meta(
+ $into,
+ 'Moose::Object',
+ 'MooseX::InsideOut::Meta::Class',
+ );
+
+ Moose->import({ into => $into });
+
+ return;
+}
1;
__END__
=head1 VERSION
-Version 0.001
+Version 0.002
=head1 SYNOPSIS
package My::Object;
- use Moose;
- extends 'MooseX::InsideOut';
+ use MooseX::InsideOut;
# ... normal Moose functionality
# or ...
use metaclass 'MooseX::InsideOut::Meta::Class';
use Moose;
- extends 'Some::Other::Class;
+ extends 'Some::Other::Class';
=head1 DESCRIPTION
MooseX::InsideOut provides a metaclass and an instance metaclass for inside-out
objects.
-You can use MooseX::InsideOut as a normal base class, as in the first example
-in the L</SYNOPSIS>.
+You can use MooseX::InsideOut, as in the first example in the L</SYNOPSIS>.
+This sets up the metaclass and instance metaclass for you, as well as importing
+all of the normal Moose goodies.
You can also use the metaclass C<MooseX::InsideOut::Meta::Class> directly, as
in the second example. This is most useful when extending a non-Moose class,