File Coverage

blib/lib/Sieve/Generator/Element/BracketComment.pm
Criterion Covered Total %
statement 15 15 100.0
branch n/a
condition 1 2 50.0
subroutine 4 4 100.0
pod 0 1 0.0
total 20 22 90.9


line stmt bran cond sub pod time code
1 1     1   1680 use v5.36.0;
  1         3  
2             package Sieve::Generator::Element::BracketComment 0.003;
3             # ABSTRACT: a Sieve bracket comment (/* ... */)
4              
5 1     1   4 use Moo;
  1         1  
  1         5  
6             with 'Sieve::Generator::Element';
7              
8             #pod =head1 DESCRIPTION
9             #pod
10             #pod A bracket comment renders as a C comment block as defined in
11             #pod RFC 5228.
12             #pod
13             #pod =attr content
14             #pod
15             #pod This attribute holds the text content of the comment.
16             #pod
17             #pod =cut
18              
19             has content => (is => 'ro', required => 1);
20              
21 1     1 0 2 sub as_sieve ($self, $i = undef) {
  1         2  
  1         2  
  1         1  
22 1   50     3 $i //= 0;
23              
24 1         2 my $indent = q{ } x $i;
25 1         5 return "${indent}/* " . $self->content . " */";
26             }
27              
28 1     1   357 no Moo;
  1         2  
  1         3  
29             1;
30              
31             __END__