Debian Codegraph @

upstream/debian-unstable/man3/TAP::Object.3perl

raw
1 .\" -*- mode: troff; coding: utf-8 -*-
2 .\" Automatically generated by Pod::Man 5.0102 (Pod::Simple 3.45)
3 .\"
4 .\" Standard preamble:
5 .\" ========================================================================
6 .de Sp \" Vertical space (when we can't use .PP)
7 .if t .sp .5v
8 .if n .sp
9 ..
10 .de Vb \" Begin verbatim text
11 .ft CW
12 .nf
13 .ne \\$1
14 ..
15 .de Ve \" End verbatim text
16 .ft R
17 .fi
18 ..
19 .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>.
20 .ie n \{\
21 . ds C` ""
22 . ds C' ""
23 'br\}
24 .el\{\
25 . ds C`
26 . ds C'
27 'br\}
28 .\"
29 .\" Escape single quotes in literal strings from groff's Unicode transform.
30 .ie \n(.g .ds Aq \(aq
31 .el .ds Aq '
32 .\"
33 .\" If the F register is >0, we'll generate index entries on stderr for
34 .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
35 .\" entries marked with X<> in POD. Of course, you'll have to process the
36 .\" output yourself in some meaningful fashion.
37 .\"
38 .\" Avoid warning from groff about undefined register 'F'.
39 .de IX
40 ..
41 .nr rF 0
42 .if \n(.g .if rF .nr rF 1
43 .if (\n(rF:(\n(.g==0)) \{\
44 . if \nF \{\
45 . de IX
46 . tm Index:\\$1\t\\n%\t"\\$2"
47 ..
48 . if !\nF==2 \{\
49 . nr % 0
50 . nr F 2
51 . \}
52 . \}
53 .\}
54 .rr rF
55 .\" ========================================================================
56 .\"
57 .IX Title "TAP::Object 3perl"
58 .TH TAP::Object 3perl 2025-11-16 "perl v5.40.1" "Perl Programmers Reference Guide"
59 .\" For nroff, turn off justification. Always turn off hyphenation; it makes
60 .\" way too many mistakes in technical documents.
61 .if n .ad l
62 .nh
63 .SH NAME
64 TAP::Object \- Base class that provides common functionality to all "TAP::*" modules
65 .SH VERSION
66 .IX Header "VERSION"
67 Version 3.48
68 .SH SYNOPSIS
69 .IX Header "SYNOPSIS"
70 .Vb 1
71 \& package TAP::Whatever;
72 \&
73 \& use strict;
74 \&
75 \& use base \*(AqTAP::Object\*(Aq;
76 \&
77 \& # new() implementation by TAP::Object
78 \& sub _initialize {
79 \& my ( $self, @args) = @_;
80 \& # initialize your object
81 \& return $self;
82 \& }
83 \&
84 \& # ... later ...
85 \& my $obj = TAP::Whatever\->new(@args);
86 .Ve
87 .SH DESCRIPTION
88 .IX Header "DESCRIPTION"
89 \&\f(CW\*(C`TAP::Object\*(C'\fR provides a default constructor and exception model for all
90 \&\f(CW\*(C`TAP::*\*(C'\fR classes. Exceptions are raised using Carp.
91 .SH METHODS
92 .IX Header "METHODS"
93 .SS "Class Methods"
94 .IX Subsection "Class Methods"
95 \fR\f(CI\*(C`new\*(C'\fR\fI\fR
96 .IX Subsection "new"
97 .PP
98 Create a new object. Any arguments passed to \f(CW\*(C`new\*(C'\fR will be passed on to the
99 "_initialize" method. Returns a new object.
100 .SS "Instance Methods"
101 .IX Subsection "Instance Methods"
102 \fR\f(CI\*(C`_initialize\*(C'\fR\fI\fR
103 .IX Subsection "_initialize"
104 .PP
105 Initializes a new object. This method is a stub by default, you should override
106 it as appropriate.
107 .PP
108 \&\fINote:\fR "new" expects you to return \f(CW$self\fR or raise an exception. See
109 "_croak", and Carp.
110 .PP
111 \fR\f(CI\*(C`_croak\*(C'\fR\fI\fR
112 .IX Subsection "_croak"
113 .PP
114 Raise an exception using \f(CW\*(C`croak\*(C'\fR from Carp, eg:
115 .PP
116 .Vb 1
117 \& $self\->_croak( \*(Aqwhy me?\*(Aq, \*(Aqaaarrgh!\*(Aq );
118 .Ve
119 .PP
120 May also be called as a \fIclass\fR method.
121 .PP
122 .Vb 1
123 \& $class\->_croak( \*(Aqthis works too\*(Aq );
124 .Ve
125 .PP
126 \fR\f(CI\*(C`_confess\*(C'\fR\fI\fR
127 .IX Subsection "_confess"
128 .PP
129 Raise an exception using \f(CW\*(C`confess\*(C'\fR from Carp, eg:
130 .PP
131 .Vb 1
132 \& $self\->_confess( \*(Aqwhy me?\*(Aq, \*(Aqaaarrgh!\*(Aq );
133 .Ve
134 .PP
135 May also be called as a \fIclass\fR method.
136 .PP
137 .Vb 1
138 \& $class\->_confess( \*(Aqthis works too\*(Aq );
139 .Ve
140 .PP
141 \fR\f(CI\*(C`_construct\*(C'\fR\fI\fR
142 .IX Subsection "_construct"
143 .PP
144 Create a new instance of the specified class.
145 .PP
146 \fR\f(CI\*(C`mk_methods\*(C'\fR\fI\fR
147 .IX Subsection "mk_methods"
148 .PP
149 Create simple getter/setters.
150 .PP
151 .Vb 1
152 \& _\|_PACKAGE_\|_\->mk_methods(@method_names);
153 .Ve