Lazy initialization of coercions
[gitmo/Mouse.git] / lib / Mouse / Object.pm
CommitLineData
c3398f5b 1package Mouse::Object;
007481ba 2use Mouse::Util qw(does dump meta); # enables strict and warnings
5ca73186 3# all the stuff are defined in XS or PP
c3398f5b 41;
c3398f5b 5__END__
6
7=head1 NAME
8
bedd575c 9Mouse::Object - The base object for Mouse classes
c3398f5b 10
a25ca8d6 11=head1 VERSION
12
420d69e8 13This document describes Mouse version 0.86
a25ca8d6 14
c3398f5b 15=head1 METHODS
16
5ca73186 17=head2 C<< $class->new(%args | \%args) -> Object >>
c3398f5b 18
1820fffe 19Instantiates a new C<Mouse::Object>. This is obviously intended for subclasses.
c3398f5b 20
5ca73186 21=head2 C<< $class->BUILDARGS(@args) -> HashRef >>
c3398f5b 22
5ca73186 23Lets you override the arguments that C<new> takes.
24It must return a HashRef of parameters.
c3398f5b 25
5ca73186 26=head2 C<< $object->BUILDALL(\%args) >>
c3398f5b 27
1820fffe 28Calls C<BUILD> on each class in the class hierarchy. This is called at the
29end of C<new>.
c3398f5b 30
5ca73186 31=head2 C<< $object->BUILD(\%args) >>
442125dc 32
1820fffe 33You may put any business logic initialization in BUILD methods. You don't
34need to redispatch or return any specific value.
442125dc 35
5ca73186 36=head2 C<< $object->DEMOLISHALL >>
c3398f5b 37
1820fffe 38Calls C<DEMOLISH> on each class in the class hierarchy. This is called at
39C<DESTROY> time.
c3398f5b 40
5ca73186 41=head2 C<< $object->DEMOLISH >>
c3398f5b 42
43You may put any business logic deinitialization in DEMOLISH methods. You don't
44need to redispatch or return any specific value.
45
5ca73186 46=head2 C<< $object->does($role_name) -> Bool >>
56a558f9 47
1820fffe 48This will check if the invocant's class B<does> a given C<$role_name>.
5ca73186 49This is similar to C<isa> for object, but it checks the roles instead.
df963a63 50
5ca73186 51=head2 C<< $object->dump($maxdepth) -> Str >>
df963a63 52
5ca73186 53This is a handy utility for dumping an object with Data::Dumper.
80a014b9 54By default, the maximum depth is 3, to avoid making a mess.
df963a63 55
80a014b9 56=head2 C<< $object->meta() -> MetaClass >>
df963a63 57
5ca73186 58This is a method which provides access to the object's metaclass.
df963a63 59
1820fffe 60=head1 SEE ALSO
61
62L<Moose::Object>
c3398f5b 63
1820fffe 64=cut
df963a63 65