X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FClass%2FMOP%2FObject.pm;h=689308c37dc1577c725b0302e649d8fe5daf1a0e;hb=ae507e19065de3734006ac4252d124e48f14e9ad;hp=b115ffa20809f11725999b40b2ec46c6a42fcf87;hpb=6e57504d833b252832d0f5306f0db97784647148;p=gitmo%2FClass-MOP.git diff --git a/lib/Class/MOP/Object.pm b/lib/Class/MOP/Object.pm index b115ffa..689308c 100644 --- a/lib/Class/MOP/Object.pm +++ b/lib/Class/MOP/Object.pm @@ -6,7 +6,8 @@ use warnings; use Scalar::Util 'blessed'; -our $VERSION = '0.01'; +our $VERSION = '0.73'; +$VERSION = eval $VERSION; our $AUTHORITY = 'cpan:STEVAN'; # introspection @@ -16,6 +17,26 @@ sub meta { Class::MOP::Class->initialize(blessed($_[0]) || $_[0]); } +sub _new { + shift->meta->new_object(@_); +} + +# RANT: +# Cmon, how many times have you written +# the following code while debugging: +# +# use Data::Dumper; +# warn Dumper $obj; +# +# It can get seriously annoying, so why +# not just do this ... +sub dump { + my $self = shift; + require Data::Dumper; + local $Data::Dumper::Maxdepth = shift || 1; + Data::Dumper::Dumper $self; +} + 1; __END__ @@ -28,7 +49,7 @@ Class::MOP::Object - Object Meta Object =head1 DESCRIPTION -This class is basically a stub, it provides no functionality at all, +This class is basically a stub, it provides almost no functionality at all, and really just exists to make the Class::MOP metamodel complete. ...... @@ -50,7 +71,7 @@ and really just exists to make the Class::MOP metamodel complete. legend: ..(is an instance of)..> - --(is a subclass of)--> + --(is a subclass of)---> A deeper discussion of this model is currently beyond the scope of this documenation. @@ -61,6 +82,14 @@ this documenation. =item B +=item B + +This will C the L module and then dump a +representation of your object. It passed the C<$max_depth> arg +to C<$Data::Dumper::Maxdepth>. The default C<$max_depth> is 1, +so it will not go crazy and print a massive bunch of stuff. +Adjust this as nessecary. + =back =head1 AUTHORS @@ -69,11 +98,11 @@ Stevan Little Estevan@iinteractive.comE =head1 COPYRIGHT AND LICENSE -Copyright 2006 by Infinity Interactive, Inc. +Copyright 2006-2008 by Infinity Interactive, Inc. L This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. -=cut \ No newline at end of file +=cut