Checking in changes prior to tagging of version 0.71.
[gitmo/Mouse.git] / lib / Mouse / Meta / Attribute.pm
index 37973a0..0bbe5c0 100644 (file)
@@ -79,21 +79,28 @@ sub new {
     }
 
     my $self = bless $args, $class;
-
-    # extra attributes
     if($class ne __PACKAGE__){
         $class->meta->_initialize_object($self, $args);
     }
-
     return $self;
 }
 
-sub has_read_method      { $_[0]->has_reader || $_[0]->has_accessor }
-sub has_write_method     { $_[0]->has_writer || $_[0]->has_accessor }
+sub has_read_method   { $_[0]->has_reader || $_[0]->has_accessor }
+sub has_write_method  { $_[0]->has_writer || $_[0]->has_accessor }
 
-sub _create_args { # DEPRECATED
-    $_[0]->{_create_args} = $_[1] if @_ > 1;
-    $_[0]->{_create_args}
+sub get_read_method   { $_[0]->reader || $_[0]->accessor }
+sub get_write_method  { $_[0]->writer || $_[0]->accessor }
+
+sub get_read_method_ref{
+    my($self) = @_;
+    return $self->{_read_method_ref}
+        ||= $self->_get_accessor_method_ref('get_read_method', '_generate_reader');
+}
+
+sub get_write_method_ref{
+    my($self) = @_;
+    return $self->{_write_method_ref}
+        ||= $self->_get_accessor_method_ref('get_write_method', '_generate_writer');
 }
 
 sub interpolate_class{
@@ -167,7 +174,7 @@ sub _throw_type_constraint_error {
 }
 
 sub illegal_options_for_inheritance {
-    return qw(is reader writer accessor clearer predicate);
+    return qw(reader writer accessor clearer predicate);
 }
 
 sub clone_and_inherit_options{
@@ -204,12 +211,6 @@ sub clone_and_inherit_options{
     return $attribute_class->new($self->name, $args);
 }
 
-sub get_read_method {
-    return $_[0]->reader || $_[0]->accessor
-}
-sub get_write_method {
-    return $_[0]->writer || $_[0]->accessor
-}
 
 sub _get_accessor_method_ref {
     my($self, $type, $generator) = @_;
@@ -226,16 +227,6 @@ sub _get_accessor_method_ref {
     }
 }
 
-sub get_read_method_ref{
-    my($self) = @_;
-    return $self->{_read_method_ref} ||= $self->_get_accessor_method_ref('get_read_method', '_generate_reader');
-}
-
-sub get_write_method_ref{
-    my($self) = @_;
-    return $self->{_write_method_ref} ||= $self->_get_accessor_method_ref('get_write_method', '_generate_writer');
-}
-
 sub set_value {
     my($self, $object, $value) = @_;
     return $self->get_write_method_ref()->($object, $value);
@@ -262,7 +253,6 @@ sub clear_value {
     return $accessor_ref->($object);
 }
 
-
 sub associate_method{
     #my($attribute, $method_name) = @_;
     my($attribute) = @_;
@@ -345,13 +335,6 @@ sub _make_delegation_method {
         ->_generate_delegation($self, $handle, $method_to_call);
 }
 
-sub throw_error{
-    my $self = shift;
-
-    my $metaclass = (ref $self && $self->associated_class) || 'Mouse::Meta::Class';
-    $metaclass->throw_error(@_, depth => 1);
-}
-
 1;
 __END__
 
@@ -361,7 +344,12 @@ Mouse::Meta::Attribute - The Mouse attribute metaclass
 
 =head1 VERSION
 
-This document describes Mouse version 0.63
+This document describes Mouse version 0.71
+
+=head1 DESCRIPTION
+
+This is a meta object protocol for Mouse attributes,
+which is a subset of Moose::Meta::Attribute.
 
 =head1 METHODS