File Coverage

blib/lib/Feed/Data/Object/Base.pm
Criterion Covered Total %
statement 15 15 100.0
branch n/a
condition n/a
subroutine 5 5 100.0
pod n/a
total 20 20 100.0


line stmt bran cond sub pod time code
1             package Feed::Data::Object::Base;
2              
3 8     8   4155 use Moo;
  8         20  
  8         43  
4 8     8   2773 use Feed::Data::Object;
  8         28  
  8         79  
5 8     8   3964 use HTML::Strip;
  8         8944  
  8         86  
6 8     8   283 use Encode qw(encode_utf8);
  8         21  
  8         781  
7 8     8   65 use Types::Standard qw/Undef Str/;
  8         21  
  8         77  
8              
9             has 'raw' => (
10             is => 'rw',
11             lazy => 1,
12             isa => Str|Undef
13             );
14              
15             has 'text' => (
16             is => 'rw',
17             lazy => 1,
18             isa => Str,
19             default => sub {
20             my $hs = HTML::Strip->new();
21             my $string = $hs->parse(shift->raw);
22             return encode_utf8($string);
23             },
24             );
25              
26             has 'json' => (
27             is => 'rw',
28             lazy => 1,
29             isa => Str,
30             default => sub {
31             return shift->text;
32             },
33             );
34              
35             1;