8 TAP::Object - Base class that provides common functionality to all C<TAP::*> modules
20 package TAP::Whatever;
27 @ISA = qw(TAP::Object);
29 # new() implementation by TAP::Object
31 my ( $self, @args) = @_;
32 # initialize your object
37 my $obj = TAP::Whatever->new(@args);
41 C<TAP::Object> provides a default constructor and exception model for all
42 C<TAP::*> classes. Exceptions are raised using L<Carp>.
50 Create a new object. Any arguments passed to C<new> will be passed on to the
51 L</_initialize> method. Returns a new object.
57 my $self = bless {}, $class;
58 return $self->_initialize(@_);
61 =head2 Instance Methods
65 Initializes a new object. This method is a stub by default, you should override
68 I<Note:> L</new> expects you to return C<$self> or raise an exception. See
69 L</_croak>, and L<Carp>.
79 Raise an exception using C<croak> from L<Carp>, eg:
81 $self->_croak( 'why me?', 'aaarrgh!' );
83 May also be called as a I<class> method.
85 $class->_croak( 'this works too' );