use List::MoreUtils qw( any all uniq first_index );
use Scalar::Util 'weaken', 'blessed';
-our $VERSION = '1.09';
+our $VERSION = '1.14';
$VERSION = eval $VERSION;
our $AUTHORITY = 'cpan:STEVAN';
);
}
-sub _immutable_options {
- my ( $self, @args ) = @_;
-
- $self->SUPER::_immutable_options(
- inline_destructor => 1,
-
- # Moose always does this when an attribute is created
- inline_accessors => 0,
-
- @args,
- );
-}
-
sub create {
my ($class, $package_name, %options) = @_;
# loop over all methods that are a part of the current class
# (not inherited)
- for my $method (map { $meta->get_method($_) } $meta->get_method_list) {
+ for my $method ( $meta->_get_local_methods ) {
# always ignore meta
next if $method->name eq 'meta';
# we'll deal with attributes below
}
}
+## Immutability
+
+sub _immutable_options {
+ my ( $self, @args ) = @_;
+
+ $self->SUPER::_immutable_options(
+ inline_destructor => 1,
+
+ # Moose always does this when an attribute is created
+ inline_accessors => 0,
+
+ @args,
+ );
+}
+
## -------------------------------------------------
our $error_level;
it uses the Moose-specific constructor and destructor classes, and
enables inlining the destructor.
-Also, since Moose always inlines attributes, it sets the
-C<inline_accessors> option to false.
+Since Moose always inlines attributes, it sets the C<inline_accessors> option
+to false.
=item B<< $metaclass->new_object(%params) >>
=item B<< $metaclass->destructor_class($class_name) >>
-These are the names of classes used when making a class
-immutable. These default to L<Moose::Meta::Method::Constructor> and
+These are the names of classes used when making a class immutable. These
+default to L<Moose::Meta::Method::Constructor> and
L<Moose::Meta::Method::Destructor> respectively. These accessors are
read-write, so you can use them to change the class name.