Subject: | FW: Moose override method |
Date: | Mon, 21 May 2012 16:12:31 +0100 |
To: | "bug-Pod-Coverage [...] rt.cpan.org" <bug-Pod-Coverage [...] rt.cpan.org> |
From: | Duncan Garland <Duncan.Garland [...] motortrak.com> |
It doesn't recognise the Moose override method:
Eg
override(
'get_labour_rate',
sub {
my ( $self, $labour_rates, $ess ) =
validate_pos( @_, 1, { type => ARRAYREF }, { type => HASHREF } );
my $hourly_rate = 0;
$self->logger->debug(
"Corporate: get_ess_labour_rate: " . Dumper( $self->temp_quote->{corporate_discounts} ) );
my $discounts = $self->temp_quote->{corporate_discounts};
if ( !$discounts->{parts_labour_rate} ) {
$hourly_rate = super( $labour_rates, $ess );
}
else {
$self->logger->debug("1. $ess->{rate}");
next if $ess->{rate} =~ m/[S]$/i;
$self->logger->debug("2. $ess->{rate}");
$hourly_rate = $discounts->{parts_labour_rate};
( $ess->{rate} ) = $discounts->{parts_labour_rate_type} =~ m/^.*(.)$/;
$self->logger->debug("2. $ess->{rate} : $hourly_rate");
}
return $hourly_rate;
}
);
From: Duncan Garland
Sent: 21 May 2012 16:10
To: 'bug-Pod-Coverage@rt.cpan.org.'
Subject: Moose override method
It doesn't recognise the Moose override method:
Eg
override(
'get_labour_rate',
sub {
my ( $self, $labour_rates, $ess ) =
validate_pos( @_, 1, { type => ARRAYREF }, { type => HASHREF } );
my $hourly_rate = 0;
$self->logger->debug(
"Corporate: get_ess_labour_rate: " . Dumper( $self->temp_quote->{corporate_discounts} ) );
my $discounts = $self->temp_quote->{corporate_discounts};
if ( !$discounts->{parts_labour_rate} ) {
$hourly_rate = super( $labour_rates, $ess );
}
else {
$self->logger->debug("1. $ess->{rate}");
next if $ess->{rate} =~ m/[S]$/i;
$self->logger->debug("2. $ess->{rate}");
$hourly_rate = $discounts->{parts_labour_rate};
( $ess->{rate} ) = $discounts->{parts_labour_rate_type} =~ m/^.*(.)$/;
$self->logger->debug("2. $ess->{rate} : $hourly_rate");
}
return $hourly_rate;
}
);