File Coverage

lib/Pod/PseudoPod/DOM/Role/PseudoPod.pm
Criterion Covered Total %
statement 9 31 29.0
branch 0 2 0.0
condition 0 2 0.0
subroutine 3 12 25.0
pod 0 9 0.0
total 12 56 21.4


line stmt bran cond sub pod time code
1             package Pod::PseudoPod::DOM::Role::PseudoPod;
2             # ABSTRACT: a P::PP::D formatter to produce PseudoPod
3              
4 1     1   878 use strict;
  1         3  
  1         31  
5 1     1   5 use warnings;
  1         2  
  1         65  
6              
7 1     1   7 use Moose::Role;
  1         2  
  1         7  
8              
9             requires 'type';
10              
11             sub emit
12             {
13 0     0 0   my $self = shift;
14 0           my $type = $self->type;
15              
16 0           my $emit = 'emit_' . $type;
17 0           $self->$emit();
18             }
19              
20 0     0 0   sub emit_document { return shift->emit_kids }
21              
22 0     0 0   sub emit_kids { join '', map { $_->emit } @{ shift->children } }
  0            
  0            
23              
24             sub emit_header
25             {
26 0     0 0   my $self = shift;
27              
28 0           return '=head1 ' . $self->text->emit . "\n\n";
29             }
30              
31             sub emit_text
32             {
33 0     0 0   my $self = shift;
34 0   0       return $self->content || '';
35             }
36              
37             sub emit_literal
38             {
39 0     0 0   my $self = shift;
40 0           return "=begin literal\n\n" . $self->emit_kids . "=end literal\n\n";
41             }
42              
43             sub emit_paragraph
44             {
45 0     0 0   my $self = shift;
46 0           my $content = $self->emit_kids;
47 0 0         return '' unless defined $content;
48 0           return $content . "\n\n";
49             }
50              
51             sub emit_anchor
52             {
53 0     0 0   my $self = shift;
54 0           return 'Z<' . $self->content->emit . '>';
55             }
56              
57             sub emit_italics
58             {
59 0     0 0   my $self = shift;
60 0           return 'I<' . $self->content->emit . '>';
61             }
62              
63             1;
64              
65             __END__
66              
67             =pod
68              
69             =encoding UTF-8
70              
71             =head1 NAME
72              
73             Pod::PseudoPod::DOM::Role::PseudoPod - a P::PP::D formatter to produce PseudoPod
74              
75             =head1 VERSION
76              
77             version 1.20210620.2032
78              
79             =head1 AUTHOR
80              
81             chromatic <chromatic@wgz.org>
82              
83             =head1 COPYRIGHT AND LICENSE
84              
85             This software is copyright (c) 2021 by chromatic.
86              
87             This is free software; you can redistribute it and/or modify it under
88             the same terms as the Perl 5 programming language system itself.
89              
90             =cut