package Moose::Meta::Attribute::Native;
-our $AUTHORITY = 'cpan:STEVAN';
+use Class::Load qw(load_class);
my @trait_names = qw(Bool Counter Number String Array Hash Code);
);
if ($meta->find_method_by_name('register_implementation')) {
my $class = $meta->name->register_implementation;
- Moose->throw_error(
+ Moose::Util::throw(
"An implementation for $trait_name already exists " .
"(found '$class' when trying to register '$trait_class')"
);
$meta->add_method(register_implementation => sub {
# resolve_metatrait_alias will load classes anyway, but throws away
# their error message; we WANT to die if there's a problem
- Class::MOP::load_class($trait_class);
+ load_class($trait_class);
return $trait_class;
});
}
example, to use this with a Hash you must specify that your attribute is some
sort of C<HashRef>.
-If you I<don't> specify a type, each trait has a default type it will use.
-
=head2 handles
This is just like any other delegation, but only a hash reference is allowed
Some traits provide a default C<is> for historical reasons. This behavior is
deprecated, and you are strongly encouraged to provide a value. If you don't
-plan to read and write the attribute value directly, you can set C<< is =>
-'bare' >> to prevent standard accessor generation.
+plan to read and write the attribute value directly, not passing the C<is>
+option will prevent standard accessor generation.
=head2 default or builder