File Coverage

blib/lib/Khonsu/Text/H4.pm
Criterion Covered Total %
statement 10 10 100.0
branch 1 2 50.0
condition 3 7 42.8
subroutine 3 3 100.0
pod 0 2 0.0
total 17 24 70.8


line stmt bran cond sub pod time code
1             package Khonsu::Text::H4;
2              
3 5     5   32 use parent 'Khonsu::Text';
  5         14  
  5         40  
4              
5             sub BUILD {
6 4     4 0 40 my ($self, %params) = @_;
7 4   50     42 $self->font->size($params{font_size} || 25);
8 4   50     22 $self->font->line_height($params{line_height} || 17);
9             }
10              
11             sub add {
12 57     57 0 217 my ($self, $file, %attributes) = @_;
13 57   33     444 $attributes{h} ||= $self->font->size;
14 57 50       305 $file->toc->outline($file, 'h4', %attributes) if $attributes{toc};
15 57         334 return $self->SUPER::add($file, %attributes);
16             }
17              
18             1;