1Moose::Object(3) User Contributed Perl Documentation Moose::Object(3)
2
3
4
6 Moose::Object - The base object for Moose
7
9 This class is the default base class for all Moose-using classes. When
10 you "use Moose" in this class, your class will inherit from this class.
11
12 It provides a default constructor and destructor, which run the
13 "BUILDALL" and "DEMOLISHALL" methods respectively.
14
15 You don't actually need to inherit from this in order to use Moose, but
16 it makes it easier to take advantage of all of Moose's features.
17
19 Moose::Object->new(%params)
20 This method calls "$class->BUILDARGS(@_)", and then creates a new
21 instance of the appropriate class. Once the instance is created, it
22 calls "$instance->BUILDALL($params)".
23
24 Moose::Object->BUILDARGS(%params)
25 The default implementation of this method accepts a hash or hash
26 reference of named parameters. If it receives a single argument
27 that isn't a hash reference it throws an error.
28
29 You can override this method in your class to handle other types of
30 options passed to the constructor.
31
32 This method should always return a hash reference of named options.
33
34 $object->BUILDALL($params)
35 This method will call every "BUILD" method in the inheritance
36 hierarchy, starting with the most distant parent class and ending
37 with the object's class.
38
39 The "BUILD" method will be passed the hash reference returned by
40 "BUILDARGS".
41
42 $object->DEMOLISHALL
43 This will call every "DEMOLISH" method in the inheritance
44 hierarchy, starting with the object's class and ending with the
45 most distant parent. "DEMOLISHALL" and "DEMOLISH" will receive a
46 boolean indicating whether or not we are currently in global
47 destruction.
48
49 $object->does($role_name)
50 This returns true if the object does the given role.
51
52 DOES ($class_or_role_name)
53 This is a a Moose role-aware implementation of "DOES" in UNIVERSAL.
54
55 This is effectively the same as writing:
56
57 $object->does($name) || $object->isa($name)
58
59 This method will work with Perl 5.8, which did not implement
60 "UNIVERSAL::DOES".
61
62 $object->dump($maxdepth)
63 This is a handy utility for "Data::Dumper"ing an object. By
64 default, the maximum depth is 1, to avoid making a mess.
65
67 See "BUGS" in Moose for details on reporting bugs.
68
70 Stevan Little <stevan@iinteractive.com>
71
73 Copyright 2006-2010 by Infinity Interactive, Inc.
74
75 <http://www.iinteractive.com>
76
77 This library is free software; you can redistribute it and/or modify it
78 under the same terms as Perl itself.
79
80
81
82perl v5.12.2 2010-08-28 Moose::Object(3)