Revision c8473408
Von Bernd Blessmann vor fast 11 Jahren hinzugefügt
SL/Helper/Csv/Dispatcher.pm | ||
---|---|---|
22 | 22 |
} |
23 | 23 |
|
24 | 24 |
sub dispatch { |
25 |
my ($self, $obj, $line) = @_; |
|
25 |
my ($self, $line) = @_; |
|
26 |
|
|
27 |
eval "require " . $self->_csv->profile->{class}; |
|
28 |
my $obj = $self->_csv->profile->{class}->new; |
|
26 | 29 |
|
27 | 30 |
for my $spec (@{ $self->_specs }) { |
28 | 31 |
$self->apply($obj, $spec, $line->{$spec->{key}}); |
29 | 32 |
} |
33 |
|
|
34 |
return $obj; |
|
30 | 35 |
} |
31 | 36 |
|
32 | 37 |
sub apply { |
... | ... | |
66 | 71 |
my ($self, %params) = @_; |
67 | 72 |
|
68 | 73 |
my $header = $self->_csv->header; |
69 |
my $profile = $self->_csv->profile; |
|
74 |
my $profile = $self->_csv->profile->{profile};
|
|
70 | 75 |
my @specs; |
71 | 76 |
|
72 | 77 |
for my $col (@$header) { |
... | ... | |
98 | 103 |
|
99 | 104 |
return unless $path; |
100 | 105 |
|
101 |
my $cur_class = $self->_csv->class;
|
|
106 |
my $cur_class = $self->_csv->profile->{class};
|
|
102 | 107 |
|
103 | 108 |
return unless $cur_class; |
104 | 109 |
|
Auch abrufbar als: Unified diff
SL::Helper::Csv bekommt Klasse im Profil mitgeteilt.