has field_order => ( is => 'ro', isa => 'ArrayRef', lazy_build => 1);
has excluded_fields => ( is => 'ro', isa => 'ArrayRef', lazy_build => 1);
-has field_labels => ( is => 'ro', isa => 'HashRef', lazy_build => 1);
+has _raw_field_labels => (
+ is => 'rw', isa => 'HashRef',
+ init_arg => 'field_labels',
+);
+has field_labels => (
+ is => 'ro', isa => 'HashRef',
+ lazy_build => 1, init_arg => undef,
+);
has computed_field_order => (is => 'ro', isa => 'ArrayRef', lazy_build => 1);
sub _build_member_class { Member };
sub _build_field_labels {
my $self = shift;
- my %labels;
- for my $field ( @{$self->computed_field_order}){
+ my %labels = %{$self->_raw_field_labels};
+ for my $field ( @{$self->computed_field_order}) {
+ next if $labels{$field};
$labels{$field} = join(' ', map{ ucfirst } split('_', $field));
}
return \%labels;