Commit | Line | Data |
4920168e |
1 | package TAP::Parser::Result::Comment; |
2 | |
3 | use strict; |
4 | |
5 | use vars qw($VERSION @ISA); |
6 | use TAP::Parser::Result; |
7 | @ISA = 'TAP::Parser::Result'; |
8 | |
9 | =head1 NAME |
10 | |
11 | TAP::Parser::Result::Comment - Comment result token. |
12 | |
13 | =head1 VERSION |
14 | |
15 | Version 3.17 |
16 | |
17 | =cut |
18 | |
19 | $VERSION = '3.17'; |
20 | |
21 | =head1 DESCRIPTION |
22 | |
23 | This is a subclass of L<TAP::Parser::Result>. A token of this class will be |
24 | returned if a comment line is encountered. |
25 | |
26 | 1..1 |
27 | ok 1 - woo hooo! |
28 | # this is a comment |
29 | |
30 | =head1 OVERRIDDEN METHODS |
31 | |
32 | Mainly listed here to shut up the pitiful screams of the pod coverage tests. |
33 | They keep me awake at night. |
34 | |
35 | =over 4 |
36 | |
37 | =item * C<as_string> |
38 | |
39 | Note that this method merely returns the comment preceded by a '# '. |
40 | |
41 | =back |
42 | |
43 | =cut |
44 | |
45 | ############################################################################## |
46 | |
47 | =head2 Instance Methods |
48 | |
49 | =head3 C<comment> |
50 | |
51 | if ( $result->is_comment ) { |
52 | my $comment = $result->comment; |
53 | print "I have something to say: $comment"; |
54 | } |
55 | |
56 | =cut |
57 | |
58 | sub comment { shift->{comment} } |
59 | sub as_string { shift->{raw} } |
60 | |
61 | 1; |