basic show works
[scpubgit/Commentry.git] / lib / App / Commentry / MappedSet.pm
CommitLineData
78fccf05 1package App::Commentry::MappedSet;
2
3use Moo;
4
5has source => (is => 'ro', required => 1);
6has mapping => (is => 'ro', required => 1);
7
8sub flatten {
9 my ($self) = @_;
10 map $self->mapping->($_), $self->source->flatten;
11}
12
13sub to_stream {
14 require HTML::Zoom::ArrayStream;
15 HTML::Zoom::ArrayStream->new({ array => [ $_[0]->flatten ] });
16}
17
181;