switch interfaces to be less weird
[gitmo/MooseX-InsideOut.git] / lib / MooseX / InsideOut.pm
CommitLineData
64468268 1use strict;
2use warnings;
3
4package MooseX::InsideOut;
5
fda3c8a5 6use MooseX::InsideOut::Meta::Class;
7BEGIN { require Moose }
8use Carp;
64468268 9
fda3c8a5 10our $VERSION = '0.002';
11
12sub import {
13 my $class = shift;
14
15 if (@_) { Carp::confess "$class has no exports" }
16
17 my $into = caller;
18
19 return if $into eq 'main';
20
21 Moose::init_meta(
22 $into,
23 'Moose::Object',
24 'MooseX::InsideOut::Meta::Class',
25 );
26
27 Moose->import({ into => $into });
28
29 return;
30}
0a374e17 31
64468268 321;
33__END__
34
35=head1 NAME
36
37MooseX::InsideOut - inside-out objects with Moose
38
39=head1 VERSION
40
fda3c8a5 41Version 0.002
64468268 42
64468268 43=head1 SYNOPSIS
44
45 package My::Object;
46
fda3c8a5 47 use MooseX::InsideOut;
64468268 48
49 # ... normal Moose functionality
50 # or ...
51
52 package My::Subclass;
53
54 use metaclass 'MooseX::InsideOut::Meta::Class';
55 use Moose;
fda3c8a5 56 extends 'Some::Other::Class';
64468268 57
58=head1 DESCRIPTION
59
60MooseX::InsideOut provides a metaclass and an instance metaclass for inside-out
61objects.
62
fda3c8a5 63You can use MooseX::InsideOut, as in the first example in the L</SYNOPSIS>.
64This sets up the metaclass and instance metaclass for you, as well as importing
65all of the normal Moose goodies.
64468268 66
67You can also use the metaclass C<MooseX::InsideOut::Meta::Class> directly, as
68in the second example. This is most useful when extending a non-Moose class,
69whose internals you either don't want to care about or aren't hash-based.
70
71=head1 TODO
72
73=over
74
75=item * dumping (for debugging purposes)
76
77=item * serialization (for e.g. storable)
78
79=item * (your suggestions here)
80
81=back
82
83=head1 AUTHOR
84
85Hans Dieter Pearcey, C<< <hdp at pobox.com> >>
86
87=head1 BUGS
88
89Please report any bugs or feature requests to C<bug-moosex-insideout at rt.cpan.org>, or through
90the web interface at L<http://rt.cpan.org/NoAuth/ReportBug.html?Queue=MooseX-InsideOut>. I will be notified, and then you'll
91automatically be notified of progress on your bug as I make changes.
92
93=head1 SUPPORT
94
95You can find documentation for this module with the perldoc command.
96
97 perldoc MooseX::InsideOut
98
99
100You can also look for information at:
101
102=over 4
103
104=item * RT: CPAN's request tracker
105
106L<http://rt.cpan.org/NoAuth/Bugs.html?Dist=MooseX-InsideOut>
107
108=item * AnnoCPAN: Annotated CPAN documentation
109
110L<http://annocpan.org/dist/MooseX-InsideOut>
111
112=item * CPAN Ratings
113
114L<http://cpanratings.perl.org/d/MooseX-InsideOut>
115
116=item * Search CPAN
117
118L<http://search.cpan.org/dist/MooseX-InsideOut>
119
120=back
121
122
123=head1 ACKNOWLEDGEMENTS
124
125
126=head1 COPYRIGHT & LICENSE
127
128Copyright 2008 Hans Dieter Pearcey.
129
130This program is free software; you can redistribute it and/or modify it
131under the same terms as Perl itself.
132
133=cut