2 use Mouse::Util qw(does dump meta); # enables strict and warnings
3 # all the stuff are defined in XS or PP
6 my($self, $class_or_role_name) = @_;
7 return $self->isa($class_or_role_name) || $self->does($class_or_role_name);
15 Mouse::Object - The base object for Mouse classes
19 This document describes Mouse version 0.95
23 =head2 C<< $class->new(%args | \%args) -> Object >>
25 Instantiates a new C<Mouse::Object>. This is obviously intended for subclasses.
27 =head2 C<< $class->BUILDARGS(@args) -> HashRef >>
29 Lets you override the arguments that C<new> takes.
30 It must return a HashRef of parameters.
32 =head2 C<< $object->BUILDALL(\%args) >>
34 Calls C<BUILD> on each class in the class hierarchy. This is called at the
37 =head2 C<< $object->BUILD(\%args) >>
39 You may put any business logic initialization in BUILD methods. You don't
40 need to redispatch or return any specific value.
42 =head2 C<< $object->DEMOLISHALL >>
44 Calls C<DEMOLISH> on each class in the class hierarchy. This is called at
47 =head2 C<< $object->DEMOLISH >>
49 You may put any business logic deinitialization in DEMOLISH methods. You don't
50 need to redispatch or return any specific value.
52 =head2 C<< $object->does($role_name) -> Bool >>
54 This will check if the invocant's class B<does> a given C<$role_name>.
55 This is similar to C<isa> for object, but it checks the roles instead.
57 =head2 C<< $object->dump($maxdepth) -> Str >>
59 This is a handy utility for dumping an object with Data::Dumper.
60 By default, the maximum depth is 3, to avoid making a mess.
62 =head2 C<< $object->meta() -> MetaClass >>
64 This is a method which provides access to the object's metaclass.