File Coverage

lib/Data/XML/Variant/Output.pm
Criterion Covered Total %
statement 11 11 100.0
branch n/a
condition n/a
subroutine 5 5 100.0
pod 2 2 100.0
total 18 18 100.0


line stmt bran cond sub pod time code
1             package Data::XML::Variant::Output;
2              
3 1     1   21680 use strict;
  1         2  
  1         76  
4             use overload
5 2     2   51 '""' => sub { shift->output },
6 1     1   2200 fallback => 1;
  1         1118  
  1         11  
7              
8              
9             =head1 NAME
10              
11             Data::XML::Variant::Output - Output class for Data::XML::Variant
12              
13             =head1 VERSION
14              
15             Version 0.01
16              
17             =cut
18              
19             our $VERSION = '0.01';
20              
21             =head1 SYNOPSIS
22              
23             Do not use this class directly. This class is merely a convenient way of
24             "tagging" data as already having been processed (for example, escapes already
25             applied).
26              
27             =head1 EXPORT
28              
29             None.
30              
31             =head1 METHODS
32              
33             =head2 new
34              
35             my $output = Data::XML::Variant::Output->new($string);
36              
37             Passed a string, the constructor will return an object with overloaded
38             stringification. When printed, it will print the string it contains.
39              
40             =cut
41              
42             sub new {
43 1     1 1 837 my ( $class, $string ) = @_;
44 1         9 bless \$string, $class;
45             }
46              
47             ##############################################################################
48              
49             =head2 output
50              
51             print $output->output;
52              
53             Returns the C<$string> passed to C.
54              
55             =cut
56              
57 3     3 1 4 sub output { ${$_[0]} }
  3         14  
58              
59             =head1 AUTHOR
60              
61             Curtis "Ovid" Poe, C<< >>
62              
63             =head1 BUGS
64              
65             Please report any bugs or feature requests to
66             C, or through the web interface at
67             L.
68             I will be notified, and then you'll automatically be notified of progress on
69             your bug as I make changes.
70              
71             =head1 ACKNOWLEDGEMENTS
72              
73             =head1 COPYRIGHT & LICENSE
74              
75             Copyright 2005 Curtis "Ovid" Poe, all rights reserved.
76              
77             This program is free software; you can redistribute it and/or modify it
78             under the same terms as Perl itself.
79              
80             =cut
81              
82             1;