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