Commit 834b6f1d authored by Andy Yates's avatar Andy Yates
Browse files

Returns default mappers from a class level. Makes serialisation using Storable...

Returns default mappers from a class level. Makes serialisation using Storable possible without bringing in B::Deparse
parent 1ff69b31
......@@ -868,25 +868,24 @@ sub batch {
#------- Internal methods
my $default_mappers = {
first_element => sub {
my ($row) = @_;
return $row->[0];
},
second_element => sub {
my ($row) = @_;
return $row->[1];
},
array_ref => sub {
my $row = shift @_;
return [@{$row}];
}
};
sub _mappers {
my ($self) = @_;
if(! exists $self->{_mappers}) {
$self->{_mappers} = {
first_element => sub {
my ($row) = @_;
return $row->[0];
},
second_element => sub {
my ($row) = @_;
return $row->[1];
},
array_ref => sub {
my $row = shift @_;
return [@{$row}];
}
};
}
return $self->{_mappers};
return $default_mappers;
}
sub _perform_transaction_code {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment