}
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 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{
my($class, $args) = @_;
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) = @_;
}
}
-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);
return $accessor_ref->($object);
}
-
sub associate_method{
#my($attribute, $method_name) = @_;
my($attribute) = @_;