lib/Text/Xatena/Node/SeeMore.pm

filter: Statementstmt 100% 26 / 26 Branchbran 100% 2 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 7 / 7 Podpod 0.0% 0 / 2 totaltotal 94.5% 35 / 37 CC 2 SCAR 2.2
CC
2
Cov
100%
parse
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.2
« blib/lib/Text/Xatena/Util.pm ↑ Summary lib/Text/Xatena/Node/SuperPre.pm »
1 package Text::Xatena::Node::SeeMore;
2  
3 19 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 19 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 19 ▶use base qw(Text::Xatena::Node);
Subroutine BEGIN: called CC=1 SCAR=0.0
6 19 ▶use Text::Xatena::Util;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 19 ▶use constant {
Subroutine BEGIN: called CC=1 SCAR=0.0
8 19 SEEMORE => qr/^====(=)?$/
9 19 };
10  
11  
12 422 ▶sub parse {
Subroutine parse: called CC=2 SCAR=6.9
Pod undocumented
13 422 my ($class, $s, $parent, $stack) = @_;
14 422 ▶ if ($s->scan(SEEMORE)) {
Branch: 1 branch
BranchTrueFalseTotal
if ($s->scan(qr/^====(=)?$/)) 4 418 422
15 4 my $is_super = $s->matched->[1];
16 4 my $node = $class->new;
17 4 $node->{is_super} = $is_super;
18 4 push @$parent, $node;
19 4 push @$stack, $node;
20 4 return 1;
21 }
22 }
23  
24 4 ▶sub as_html {
Subroutine as_html: called CC=1 SCAR=0.0
Pod undocumented
25 4 my ($self, $context, %opts) = @_;
26 4 $context->_tmpl(__PACKAGE__, q[
27 <div class="seemore">
28 {{= $content }}
29 </div>
30 ], {
31 content => $self->SUPER::as_html($context, %opts),
32 });
33 }
34  
35 19 1;
36 __END__
« blib/lib/Text/Xatena/Util.pm ↑ Summary lib/Text/Xatena/Node/SuperPre.pm »