bump version to 0.75
[gitmo/Class-MOP.git] / lib / Class / MOP / Object.pm
CommitLineData
6e57504d 1
2package Class::MOP::Object;
3
4use strict;
5use warnings;
6
7use Scalar::Util 'blessed';
8
db4c4962 9our $VERSION = '0.75';
d519662a 10$VERSION = eval $VERSION;
6e57504d 11our $AUTHORITY = 'cpan:STEVAN';
12
13# introspection
14
15sub meta {
16 require Class::MOP::Class;
17 Class::MOP::Class->initialize(blessed($_[0]) || $_[0]);
18}
19
4e99d48b 20sub _new {
21 shift->meta->new_object(@_);
22}
23
c4260b45 24# RANT:
25# Cmon, how many times have you written
26# the following code while debugging:
27#
28# use Data::Dumper;
29# warn Dumper $obj;
30#
31# It can get seriously annoying, so why
32# not just do this ...
33sub dump {
34 my $self = shift;
35 require Data::Dumper;
acce7fd6 36 local $Data::Dumper::Maxdepth = shift || 1;
c4260b45 37 Data::Dumper::Dumper $self;
38}
39
6e57504d 401;
41
42__END__
43
44=pod
45
46=head1 NAME
47
48Class::MOP::Object - Object Meta Object
49
50=head1 DESCRIPTION
51
121991f6 52This class is basically a stub, it provides almost no functionality at all,
6e57504d 53and really just exists to make the Class::MOP metamodel complete.
54
55 ......
56 : :
57 : v
58 +-------------------+
59 +-----| Class::MOP::Class |
60 | +-------------------+
61 | ^ ^ ^
62 v : : :
63 +--------------------+ : +--------------------+
64 | Class::MOP::Module | : | Class::MOP::Object |
65 +--------------------+ : +--------------------+
66 | : ^
67 | : |
68 | +---------------------+ |
69 +--->| Class::MOP::Package |-----+
70 +---------------------+
71
72 legend:
73 ..(is an instance of)..>
88dd563c 74 --(is a subclass of)--->
6e57504d 75
76A deeper discussion of this model is currently beyond the scope of
77this documenation.
78
79=head1 METHODS
80
81=over 4
82
83=item B<meta>
84
c4260b45 85=item B<dump (?$max_depth)>
86
88dd563c 87This will C<require> the L<Data::Dumper> module and then dump a
88representation of your object. It passed the C<$max_depth> arg
89to C<$Data::Dumper::Maxdepth>. The default C<$max_depth> is 1,
90so it will not go crazy and print a massive bunch of stuff.
91Adjust this as nessecary.
92
6e57504d 93=back
94
95=head1 AUTHORS
96
97Stevan Little E<lt>stevan@iinteractive.comE<gt>
98
99=head1 COPYRIGHT AND LICENSE
100
69e3ab0a 101Copyright 2006-2008 by Infinity Interactive, Inc.
6e57504d 102
103L<http://www.iinteractive.com>
104
105This library is free software; you can redistribute it and/or modify
106it under the same terms as Perl itself.
107
88dd563c 108=cut