2ch/Res.pm untested

filter: Statementstmt 0.0% 0 / 23 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 5 Podpod 0.0% 0 / 3 totaltotal 0.0% 0 / 31 CC 1 SCAR 6.9
CC
1
Cov
0%
new
2.0
body_text
2.0
permalink
2.0
CRAP 2.0
1 package WWW::2ch::Res;
2 use strict;
3  
4 use base qw( Class::Accessor::Fast );
5 __PACKAGE__->mk_accessors( qw( c key resid num name mail date time id be body ) );
6  
7 sub new {
8 my $class = shift;
9 my $c = shift;
10 my $opt = shift;
11 my $self = bless $opt, $class;
12 $self->c($c);
13 $self;
14 }
15  
16 sub body_text {
17 my $self = shift;
18 my $body = $self->body;
19 $body =~ s/<br>/\n/ig;
20 $body =~ s/<[^>]*>//g;
21 $body =~ s/&lt;/</g;
22 $body =~ s/&gt;/>/g;
23 $body;
24 }
25  
26 sub permalink {
27 my ($self) = @_;
28 $self->c->worker->permalink($self->key, $self->resid);
29 }
30  
31 1;
32  
33 __END__