| 1 | # E2::Superdoc | ||||||||||||||||||||
| 2 | # Jose M. Weeks <jose@joseweeks.com> | ||||||||||||||||||||
| 3 | # 07 August 2003 | ||||||||||||||||||||
| 4 | # | ||||||||||||||||||||
| 5 | # See bottom for pod documentation. | ||||||||||||||||||||
| 6 | |||||||||||||||||||||
| 7 | package E2::Superdoc; | ||||||||||||||||||||
| 8 | |||||||||||||||||||||
| 9 | 2 | ▶ | use 5.006; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 10 | 2 | ▶ | use strict; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 11 | 2 | ▶ | use warnings; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 12 | 2 | ▶ | use Carp; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 13 | |||||||||||||||||||||
| 14 | 2 | ▶ | use E2::Node; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 15 | |||||||||||||||||||||
| 16 | 2 | our @ISA = "E2::Node"; | |||||||||||||||||||
| 17 | 2 | our $VERSION = "0.34"; | |||||||||||||||||||
| 18 | 2 | our $DEBUG; *DEBUG = *E2::Interface::DEBUG; | |||||||||||||||||||
| 19 | |||||||||||||||||||||
| 20 | # Prototypes | ||||||||||||||||||||
| 21 | |||||||||||||||||||||
| 22 | sub new; | ||||||||||||||||||||
| 23 | sub clear; | ||||||||||||||||||||
| 24 | |||||||||||||||||||||
| 25 | sub text; | ||||||||||||||||||||
| 26 | |||||||||||||||||||||
| 27 | # Private | ||||||||||||||||||||
| 28 | |||||||||||||||||||||
| 29 | sub type_as_string; | ||||||||||||||||||||
| 30 | sub twig_handlers; | ||||||||||||||||||||
| 31 | |||||||||||||||||||||
| 32 | # Object Methods | ||||||||||||||||||||
| 33 | |||||||||||||||||||||
| 34 | 1 | ▶ | sub new { | ||||||||||||||||||
|
Subroutine
new: called CC=2 SCAR=7.2
Pod
documented
| |||||||||||||||||||||
| 35 | 1 | my $arg = shift; | |||||||||||||||||||
| 36 | 1 | ▶ | my $class = ref( $arg ) || $arg; | ||||||||||||||||||
|
Condition33%1/3
ref $arg || $arg
MC/DC0%0/2
ref $arg || $arg
ref $arg
$arg
Truth table33%1/3
A || B
A= ref $argB= $arg
| |||||||||||||||||||||
| 37 | 1 | my $self = $class->SUPER::new(); | |||||||||||||||||||
| 38 | |||||||||||||||||||||
| 39 | # See clear for the other members of $self | ||||||||||||||||||||
| 40 | |||||||||||||||||||||
| 41 | 1 | $self->clear; | |||||||||||||||||||
| 42 | 1 | return $self; | |||||||||||||||||||
| 43 | } | ||||||||||||||||||||
| 44 | |||||||||||||||||||||
| 45 | 3 | ▶ | sub clear { | ||||||||||||||||||
|
Subroutine
clear: called CC=3 SCAR=11.4
Pod
documented
| |||||||||||||||||||||
| 46 | 3 | ▶ | my $self = shift or croak "Usage: clear E2SUPERDOC"; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 47 | |||||||||||||||||||||
| 48 | 3 | ▶ | warn "E2::Superdoc::clear\n" if $DEBUG > 1; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 49 | |||||||||||||||||||||
| 50 | 3 | $self->{text} = undef; | |||||||||||||||||||
| 51 | |||||||||||||||||||||
| 52 | # Now clear parent | ||||||||||||||||||||
| 53 | |||||||||||||||||||||
| 54 | 3 | return $self->SUPER::clear; | |||||||||||||||||||
| 55 | } | ||||||||||||||||||||
| 56 | |||||||||||||||||||||
| 57 | 0 | ▶ | sub text { | ||||||||||||||||||
|
Subroutine
text: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||||||||||||
| 58 | 0 | ▶ | my $self = shift or croak "Usage: tetx E2SUPERDOC"; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 59 | |||||||||||||||||||||
| 60 | 0 | return $self->{text}; | |||||||||||||||||||
| 61 | } | ||||||||||||||||||||
| 62 | |||||||||||||||||||||
| 63 | 1 | ▶ | sub twig_handlers { | ||||||||||||||||||
|
Subroutine
twig_handlers: called CC=2 SCAR=9.2
Pod
undocumented
| |||||||||||||||||||||
| 64 | 1 | ▶ | my $self = shift or croak "Usage: twig_handlers E2SUPERDOC"; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 65 | |||||||||||||||||||||
| 66 | return ( | ||||||||||||||||||||
| 67 | |||||||||||||||||||||
| 68 | 0 | ▶ | 'node/superdoctext' => sub { | ||||||||||||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||||||||||||
| 69 | 0 | (my $a, my $b) = @_; | |||||||||||||||||||
| 70 | 0 | $self->{text} = $b->text; | |||||||||||||||||||
| 71 | } | ||||||||||||||||||||
| 72 | 1 | ); | |||||||||||||||||||
| 73 | } | ||||||||||||||||||||
| 74 | |||||||||||||||||||||
| 75 | 1 | ▶ | sub type_as_string { | ||||||||||||||||||
|
Subroutine
type_as_string: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||
| 76 | 1 | return 'superdoc'; | |||||||||||||||||||
| 77 | } | ||||||||||||||||||||
| 78 | |||||||||||||||||||||
| 79 | 2 | 1; | |||||||||||||||||||
| 80 | __END__ | ||||||||||||||||||||