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

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