confess("mk_classdata() is a class method, not an object method")
if blessed $class;
- my $slot = '$'.$attribute;
my $accessor = sub {
my $pkg = ref $_[0] || $_[0];
my $meta = Moose::Util::find_meta($pkg)
}
# tighter version of
- # if ( $meta->has_package_symbol($slot) ) {
- # return ${ $meta->get_package_symbol($slot) };
+ # if ( $meta->has_package_symbol('$'.$attribute) ) {
+ # return ${ $meta->get_package_symbol('$'.$attribute) };
# }
no strict 'refs';
my $v = *{"${pkg}::${attribute}"}{SCALAR};
return;
};
- confess("Failed to create accessor: $@ ")
- unless ref $accessor eq 'CODE';
-
my $meta = $class->Class::MOP::Object::meta();
confess "${class}'s metaclass is not a Class::MOP::Class"
unless $meta->isa('Class::MOP::Class');
my $was_immutable = $meta->is_immutable;
- # Need to save immutable_options if they're available from Moose 0.89_02
- my %immutable_options = $meta->can('immutable_options') ? $meta->immutable_options : ();
+ my %immutable_options = $meta->immutable_options;
$meta->make_mutable if $was_immutable;
=head1 AUTHOR
+=begin stopwords
+
Guillermo Roditi
+=end stopwords
+
=head1 COPYRIGHT
This library is free software. You can redistribute it and/or modify it under