| 1 | # ABSTRACT: Writer class for YAML::PP representing output data | ||||||||||
| 2 | 50 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 3 | 50 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | package YAML::PP::Writer; | ||||||||||
| 5 | |||||||||||
| 6 | 50 | our $VERSION = 'v0.43.0'; # VERSION | |||||||||
| 7 | |||||||||||
| 8 | 3063 | ▶ | sub output { return $_[0]->{output} } | ||||||||
|
Subroutine
output: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||
| 9 | 6879 | ▶ | sub set_output { $_[0]->{output} = $_[1] } | ||||||||
|
Subroutine
set_output: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||
| 10 | |||||||||||
| 11 | 5207 | ▶ | sub new { | ||||||||
|
Subroutine
new: called CC=2 SCAR=6.9
Pod
documented
| |||||||||||
| 12 | 5207 | my ($class, %args) = @_; | |||||||||
| 13 | 5207 | my $output = delete $args{output}; | |||||||||
| 14 | 5207 | ▶ | $output = '' unless defined $output; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 15 | 5207 | return bless { | |||||||||
| 16 | output => $output, | ||||||||||
| 17 | }, $class; | ||||||||||
| 18 | } | ||||||||||
| 19 | |||||||||||
| 20 | 13116 | ▶ | sub write { | ||||||||
|
Subroutine
write: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||
| 21 | 13116 | my ($self, $line) = @_; | |||||||||
| 22 | 13116 | $self->{output} .= $line; | |||||||||
| 23 | } | ||||||||||
| 24 | |||||||||||
| 25 | 5300 | ▶ | sub init { | ||||||||
|
Subroutine
init: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||
| 26 | 5300 | $_[0]->set_output(''); | |||||||||
| 27 | } | ||||||||||
| 28 | |||||||||||
| 29 | 1579 | ▶ | sub finish { | ||||||||
|
Subroutine
finish: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||
| 30 | 1579 | my ($self) = @_; | |||||||||
| 31 | 1579 | $_[0]->set_output(undef); | |||||||||
| 32 | } | ||||||||||
| 33 | |||||||||||
| 34 | 50 | 1; | |||||||||
| 35 | |||||||||||
| 36 | __END__ | ||||||||||