blib/lib/Yukki/Model/FilePreview.pm untested

filter: Statementstmt 0.0% 0 / 19 Branchbran n/a Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 0.0% 0 / 2 Podpod n/a totaltotal 0.0% 0 / 26 CC 1 SCAR 6.9
CC
1
Cov
0%
BEGIN
2.0
BEGIN
2.0
CRAP 2.0
1 package Yukki::Model::FilePreview;
2 {
3 $Yukki::Model::FilePreview::VERSION = '0.140290';
4 }
5 use 5.12.1;
6 use Moose;
7  
8 extends 'Yukki::Model::File';
9  
10 # ABSTRACT: a sub-class of the File model for handling previews
11  
12  
13 has content => (
14 is => 'rw',
15 isa => 'Str',
16 required => 1,
17 );
18  
19  
20 has position => (
21 is => 'rw',
22 isa => 'Int',
23 required => 1,
24 default => -1,
25 );
26  
27  
28 override fetch => sub {
29 my $self = shift;
30 return $self->content;
31 };
32  
33  
34 override fetch_formatted => sub {
35 my ($self, $ctx, $position) = @_;
36 $position //= $self->position;
37 return $self->SUPER::fetch_formatted($ctx, $position);
38 };
39  
40 1;
41  
42 __END__