my $accessor = sub {
my $pkg = ref $_[0] || $_[0];
my $meta = $pkg->Class::MOP::Object::meta();
- if (@_ > 1){
+ if (@_ > 1) {
$meta->namespace->{$attribute} = \$_[1];
return $_[1];
}
$meta->add_method($alias, $accessor);
$meta->add_method($attribute, $accessor);
if(defined $immutable_options){
- $meta->make_immutable($immutable_options);
+ $meta->make_immutable(%{ $immutable_options });
}
$class->$attribute($_[2]) if(@_ > 2);
return $accessor;