Convert Moose->throw_error to Moose::Util::throw
[gitmo/Moose.git] / lib / Moose / Meta / Attribute / Native.pm
index e880bec..05ccf7a 100644 (file)
@@ -1,8 +1,6 @@
 package Moose::Meta::Attribute::Native;
 
-our $VERSION   = '1.17';
-$VERSION = eval $VERSION;
-our $AUTHORITY = 'cpan:STEVAN';
+use Class::Load qw(load_class);
 
 my @trait_names = qw(Bool Counter Number String Array Hash Code);
 
@@ -13,7 +11,7 @@ for my $trait_name (@trait_names) {
     );
     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')"
         );
@@ -21,21 +19,19 @@ for my $trait_name (@trait_names) {
     $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;
     });
 }
 
 1;
 
+# ABSTRACT: Delegate to native Perl types
+
 __END__
 
 =pod
 
-=head1 NAME
-
-Moose::Meta::Attribute::Native - Delegate to native Perl types
-
 =head1 SYNOPSIS
 
   package MyClass;
@@ -95,8 +91,6 @@ You will need to make sure that the attribute has an appropriate type. For
 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
@@ -111,8 +105,8 @@ See the docs for each native trait for details on what methods are available.
 
 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
 
@@ -247,47 +241,4 @@ the API were changed.
 
 See L<Moose/BUGS> for details on reporting bugs.
 
-=head1 AUTHOR
-
-Stevan Little E<lt>stevan@iinteractive.comE<gt>
-
-B<with contributions from:>
-
-Robert (rlb3) Boone
-
-Paul (frodwith) Driver
-
-Shawn (Sartak) Moore
-
-Chris (perigrin) Prather
-
-Robert (phaylon) Sedlacek
-
-Tom (dec) Lanyon
-
-Yuval Kogman
-
-Jason May
-
-Cory (gphat) Watson
-
-Florian (rafl) Ragwitz
-
-Evan Carroll
-
-Jesse (doy) Luehrs
-
-Jay Hannah
-
-Robert Buels
-
-=head1 COPYRIGHT AND LICENSE
-
-Copyright 2007-2009 by Infinity Interactive, Inc.
-
-L<http://www.iinteractive.com>
-
-This library is free software; you can redistribute it and/or modify
-it under the same terms as Perl itself.
-
 =cut