Separate out App::IdiotBox::* DB objects and put create/update
[catagits/App-IdiotBox.git] / lib / App / IdiotBox / Video.pm
CommitLineData
f29e9b6f 1package App::IdiotBox::Video;
2
3use Moo;
4
5sub fields { return qw(slug bucket_slug name author details announcement_id) }
6
7sub slug { shift->{slug} }
8sub name { shift->{name} }
9sub author { shift->{author} }
10sub details { shift->{details} }
11sub bucket { shift->{bucket} }
12sub file_name {
13 (my $s = join(' ', @{+shift}{qw(author name)})) =~ s/ /-/g;
14 $s;
15}
16sub url_path {
17 join('/', $_[0]->bucket->slug, $_[0]->slug);
18}
19
201;