xref: /openbsd-src/gnu/usr.bin/perl/cpan/Test-Harness/lib/TAP/Parser/Result/Pragma.pm (revision d13be5d47e4149db2549a9828e244d59dbc43f15)
1package TAP::Parser::Result::Pragma;
2
3use strict;
4
5use vars qw($VERSION @ISA);
6use TAP::Parser::Result;
7@ISA = 'TAP::Parser::Result';
8
9=head1 NAME
10
11TAP::Parser::Result::Pragma - TAP pragma token.
12
13=head1 VERSION
14
15Version 3.17
16
17=cut
18
19$VERSION = '3.17';
20
21=head1 DESCRIPTION
22
23This is a subclass of L<TAP::Parser::Result>.  A token of this class will be
24returned if a pragma is encountered.
25
26 TAP version 13
27 pragma +strict, -foo
28
29Pragmas are only supported from TAP version 13 onwards.
30
31=head1 OVERRIDDEN METHODS
32
33Mainly listed here to shut up the pitiful screams of the pod coverage tests.
34They keep me awake at night.
35
36=over 4
37
38=item * C<as_string>
39
40=item * C<raw>
41
42=back
43
44=cut
45
46##############################################################################
47
48=head2 Instance Methods
49
50=head3 C<pragmas>
51
52if ( $result->is_pragma ) {
53    @pragmas = $result->pragmas;
54}
55
56=cut
57
58sub pragmas {
59    my @pragmas = @{ shift->{pragmas} };
60    return wantarray ? @pragmas : \@pragmas;
61}
62
631;
64