1 package DBIx::Data::Stream::Mapped;
7 bless({ %{$_[0]} }, ref($proto)||$proto);
10 sub _inner { shift->{inner} }
11 sub _clear_inner { delete shift->{inner} }
12 sub _mapper { shift->{mapper} }
15 return unless my $inner = (my $self = shift)->_inner;
16 # If we were aiming for a "true" perl-like map then we should
17 # elegantly handle the case where the map function returns 0 events
18 # and the case where it returns >1 - if you're reading this comment
19 # because you wanted it to do that, now would be the time to fix it :)
20 my $mapper = $self->_mapper;
21 if (my ($next) = $inner->next) {
23 return $mapper->($next);