|| confess "Whoops, not møøsey enough";
}
else {
- $meta = Moose::Meta::Class->initialize($class => (
- ':attribute_metaclass' => 'Moose::Meta::Attribute'
- ));
+ $meta = Moose::Meta::Class->initialize($class);
$meta->add_method('meta' => sub {
# re-initialize so it inherits properly
- Moose::Meta::Class->initialize($class => (
- ':attribute_metaclass' => 'Moose::Meta::Attribute'
- ));
+ Moose::Meta::Class->initialize($class);
})
}
my $meta = _find_meta();
return subname 'Moose::has' => sub {
my ($name, %options) = @_;
- $meta->add_attribute($name, %options)
+ if ($options{metaclass}) {
+ _load_all_classes($options{metaclass});
+ $meta->add_attribute($options{metaclass}->new($name, %options));
+ }
+ else {
+ $meta->add_attribute($name, %options);
+ }
};
},
before => sub {