File Coverage

blib/lib/Data/Record/Serialize/Sink/stream.pm
Criterion Covered Total %
statement 9 10 90.0
branch n/a
condition n/a
subroutine 4 5 80.0
pod 0 2 0.0
total 13 17 76.4


line stmt bran cond sub pod time code
1             package Data::Record::Serialize::Sink::stream;
2              
3             # ABSTRACT: output encoded data to a stream.
4              
5 7     7   4138 use v5.10;
  7         43  
6 7     7   57 use Moo::Role;
  7         21  
  7         72  
7              
8             our $VERSION = '1.05';
9              
10 7     7   3136 use namespace::clean;
  7         24  
  7         48  
11              
12             with 'Data::Record::Serialize::Role::Sink::Stream';
13              
14              
15              
16              
17              
18              
19 0     0 0 0 sub print { shift->fh->print( @_ ) }
20 33     33 0 2123 sub say { shift->fh->say( @_ ) }
21              
22             with 'Data::Record::Serialize::Role::Sink';
23              
24             1;
25              
26             #
27             # This file is part of Data-Record-Serialize
28             #
29             # This software is Copyright (c) 2017 by Smithsonian Astrophysical Observatory.
30             #
31             # This is free software, licensed under:
32             #
33             # The GNU General Public License, Version 3, June 2007
34             #
35              
36             __END__
37              
38             =pod
39              
40             =for :stopwords Diab Jerius Smithsonian Astrophysical Observatory
41              
42             =head1 NAME
43              
44             Data::Record::Serialize::Sink::stream - output encoded data to a stream.
45              
46             =head1 VERSION
47              
48             version 1.05
49              
50             =head1 SYNOPSIS
51              
52             use Data::Record::Serialize;
53              
54             my $s = Data::Record::Serialize->new( sink => 'stream', ... );
55              
56             $s->send( \%record );
57              
58             =head1 DESCRIPTION
59              
60             B<Data::Record::Serialize::Sink::stream> outputs encoded data to a
61             file handle.
62              
63             It performs the L<Data::Record::Serialize::Role::Sink> role.
64              
65             =head1 INTERNALS
66              
67             =for Pod::Coverage print
68             say
69              
70             =head1 INTERFACE
71              
72             The following attributes may be passed to
73             L<Data::Record::Serialize-E<gt>new>|Data::Record::Serialize/new>:
74              
75             =over
76              
77             =item C<output>
78              
79             The name of an output file or a reference to a scalar to which the records will be written.
80             C<output> may be set to C<-> to indicate output to the standard output stream.
81              
82             =item C<fh>
83              
84             A file handle.
85              
86             =back
87              
88             If neither is specified, output is written to the standard output
89             stream.
90              
91             =head1 SUPPORT
92              
93             =head2 Bugs
94              
95             Please report any bugs or feature requests to bug-data-record-serialize@rt.cpan.org or through the web interface at: L<https://rt.cpan.org/Public/Dist/Display.html?Name=Data-Record-Serialize>
96              
97             =head2 Source
98              
99             Source is available at
100              
101             https://gitlab.com/djerius/data-record-serialize
102              
103             and may be cloned from
104              
105             https://gitlab.com/djerius/data-record-serialize.git
106              
107             =head1 SEE ALSO
108              
109             Please see those modules/websites for more information related to this module.
110              
111             =over 4
112              
113             =item *
114              
115             L<Data::Record::Serialize|Data::Record::Serialize>
116              
117             =back
118              
119             =head1 AUTHOR
120              
121             Diab Jerius <djerius@cpan.org>
122              
123             =head1 COPYRIGHT AND LICENSE
124              
125             This software is Copyright (c) 2017 by Smithsonian Astrophysical Observatory.
126              
127             This is free software, licensed under:
128              
129             The GNU General Public License, Version 3, June 2007
130              
131             =cut