## Method generation helpers
-sub generate_accessor_method {
+sub _generate_accessor_method {
my $attr = (shift)->associated_attribute;
my $meta_class = $attr->associated_class;
my $attr_name = $attr->name;
};
}
-sub generate_reader_method {
+sub _generate_reader_method {
my $attr = (shift)->associated_attribute;
my $meta_class = $attr->associated_class;
my $attr_name = $attr->name;
};
}
-sub generate_writer_method {
+sub _generate_writer_method {
my $attr = (shift)->associated_attribute;
my $meta_class = $attr->associated_class;
my $attr_name = $attr->name;
};
}
-sub generate_predicate_method {
+sub _generate_predicate_method {
my $attr = (shift)->associated_attribute;
my $meta_class = $attr->associated_class;
my $attr_name = $attr->name;
my $self = shift;
my $method_name = join "_" => (
- 'generate',
+ '_generate',
$self->accessor_type,
'method',
($self->is_inline ? 'inline' : ())
## generators
sub generate_accessor_method {
+ warn 'The generate_accessor_method method has been made private.'
+ . " The public version is deprecated and will be removed in a future release.\n";
+ goto &_generate_accessor_method;
+}
+
+sub _generate_accessor_method {
my $attr = (shift)->associated_attribute;
return sub {
$attr->set_value($_[0], $_[1]) if scalar(@_) == 2;
}
sub generate_reader_method {
+ warn 'The generate_reader_method method has been made private.'
+ . " The public version is deprecated and will be removed in a future release.\n";
+ goto &_generate_reader_method;
+}
+
+sub _generate_reader_method {
my $attr = (shift)->associated_attribute;
return sub {
confess "Cannot assign a value to a read-only accessor" if @_ > 1;
}
sub generate_writer_method {
+ warn 'The generate_writer_method method has been made private.'
+ . " The public version is deprecated and will be removed in a future release.\n";
+ goto &_generate_writer_method;
+}
+
+sub _generate_writer_method {
my $attr = (shift)->associated_attribute;
return sub {
$attr->set_value($_[0], $_[1]);
}
sub generate_predicate_method {
+ warn 'The generate_predicate_method method has been made private.'
+ . " The public version is deprecated and will be removed in a future release.\n";
+ goto &_generate_predicate_method;
+}
+
+sub _generate_predicate_method {
my $attr = (shift)->associated_attribute;
return sub {
$attr->has_value($_[0])
}
sub generate_clearer_method {
+ warn 'The generate_clearer_method method has been made private.'
+ . " The public version is deprecated and will be removed in a future release.\n";
+ goto &_generate_clearer_method;
+}
+
+sub _generate_clearer_method {
my $attr = (shift)->associated_attribute;
return sub {
$attr->clear_value($_[0])
## Inline methods
-
sub generate_accessor_method_inline {
+ warn 'The generate_accessor_method_inline method has been made private.'
+ . " The public version is deprecated and will be removed in a future release.\n";
+ goto &_generate_accessor_method_inline;
+}
+
+sub _generate_accessor_method_inline {
my $self = shift;
my $attr = $self->associated_attribute;
my $attr_name = $attr->name;
}
sub generate_reader_method_inline {
+ warn 'The generate_reader_method_inline method has been made private.'
+ . " The public version is deprecated and will be removed in a future release.\n";
+ goto &_generate_reader_method_inline;
+}
+
+sub _generate_reader_method_inline {
my $self = shift;
my $attr = $self->associated_attribute;
my $attr_name = $attr->name;
}
sub generate_writer_method_inline {
+ warn 'The generate_writer_method_inline method has been made private.'
+ . " The public version is deprecated and will be removed in a future release.\n";
+ goto &_generate_writer_method_inline;
+}
+
+sub _generate_writer_method_inline {
my $self = shift;
my $attr = $self->associated_attribute;
my $attr_name = $attr->name;
return $code;
}
-
sub generate_predicate_method_inline {
+ warn 'The generate_predicate_method_inline method has been made private.'
+ . " The public version is deprecated and will be removed in a future release.\n";
+ goto &_generate_predicate_method_inline;
+}
+
+sub _generate_predicate_method_inline {
my $self = shift;
my $attr = $self->associated_attribute;
my $attr_name = $attr->name;
}
sub generate_clearer_method_inline {
+ warn 'The generate_clearer_method_inline method has been made private.'
+ . " The public version is deprecated and will be removed in a future release.\n";
+ goto &_generate_clearer_method_inline;
+}
+
+sub _generate_clearer_method_inline {
my $self = shift;
my $attr = $self->associated_attribute;
my $attr_name = $attr->name;