File: SubclassTest.pm

package info (click to toggle)
perl 5.20.2-3%2Bdeb8u11
  • links: PTS, VCS
  • area: main
  • in suites: jessie
  • size: 102,964 kB
  • sloc: perl: 555,553; ansic: 214,041; sh: 38,121; pascal: 8,783; cpp: 3,895; makefile: 2,393; xml: 2,325; yacc: 1,741
file content (37 lines) | stat: -rw-r--r-- 1,053 bytes parent folder | download | duplicates (14)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# subclass for testing subclassing

package TAP::Parser::SubclassTest;

use strict;
use warnings;

use MySourceHandler;
use MyPerlSourceHandler;
use MyGrammar;
use MyResultFactory;

use base qw( TAP::Parser MyCustom );

sub _default_source_class         {'MySourceHandler'}        # deprecated
sub _default_perl_source_class    {'MyPerlSourceHandler'}    # deprecated
sub _default_grammar_class        {'MyGrammar'}
sub _default_result_factory_class {'MyResultFactory'}

sub make_source { shift->SUPER::make_source(@_)->custom }    # deprecated

sub make_perl_source {
    shift->SUPER::make_perl_source(@_)->custom;
}                                                            # deprecated
sub make_grammar  { shift->SUPER::make_grammar(@_)->custom }
sub make_iterator { shift->SUPER::make_iterator(@_)->custom }    # deprecated
sub make_result   { shift->SUPER::make_result(@_)->custom }

sub _initialize {
    my $self = shift;
    $self->SUPER::_initialize(@_);
    $main::INIT{ ref($self) }++;
    $self->{initialized} = 1;
    return $self;
}

1;