| 1 | # Copyright (C) 2003-2007, G. Allen Morris III, all rights reserved | ||||||||||||
| 2 | |||||||||||||
| 3 | 7 | ▶ | use strict; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 4 | |||||||||||||
| 5 | package | ||||||||||||
| 6 | Data::Tabular::Output; | ||||||||||||
| 7 | |||||||||||||
| 8 | 7 | ▶ | use Carp qw (croak); | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 9 | |||||||||||||
| 10 | 7 | ▶ | use overload '""' => \&render; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 11 | |||||||||||||
| 12 | sub new | ||||||||||||
| 13 | 1 | ▶ | { | ||||||||||
|
Subroutine
new: called CC=3 SCAR=11.2
Pod
undocumented
| |||||||||||||
| 14 | 1 | my $class = shift; | |||||||||||
| 15 | 1 | my $args = { @_ }; | |||||||||||
| 16 | |||||||||||||
| 17 | 1 | my $self = bless {}, $class; | |||||||||||
| 18 | |||||||||||||
| 19 | 1 | ▶ | die 'No table' unless $args->{table}; | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 20 | 1 | $self->{table} = $args->{table}; | |||||||||||
| 21 | |||||||||||||
| 22 | 1 | ▶ | $self->{output} = $args->{output} || croak "Need output"; | ||||||||||
|
Condition50%1/2
$args->{'output'} || croak('Need output')
MC/DC0%0/1
$args->{'output'} || croak('Need output')
$args->{'output'}
Truth table50%1/2
A
A= $args->{'output'}
| |||||||||||||
| 23 | |||||||||||||
| 24 | 1 | $self; | |||||||||||
| 25 | } | ||||||||||||
| 26 | |||||||||||||
| 27 | sub rows | ||||||||||||
| 28 | 12 | ▶ | { | ||||||||||
|
Subroutine
rows: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||
| 29 | 12 | my $self = shift; | |||||||||||
| 30 | |||||||||||||
| 31 | 12 | $self->{table}->rows(output => $self->output); | |||||||||||
| 32 | } | ||||||||||||
| 33 | |||||||||||||
| 34 | sub columns | ||||||||||||
| 35 | 5 | ▶ | { | ||||||||||
|
Subroutine
columns: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||
| 36 | 5 | my $self = shift; | |||||||||||
| 37 | |||||||||||||
| 38 | 5 | $self->{table}->columns(output => $self->output); | |||||||||||
| 39 | } | ||||||||||||
| 40 | |||||||||||||
| 41 | sub output | ||||||||||||
| 42 | 355 | ▶ | { | ||||||||||
|
Subroutine
output: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||
| 43 | 355 | my $self = shift; | |||||||||||
| 44 | 355 | $self->{output}; | |||||||||||
| 45 | } | ||||||||||||
| 46 | |||||||||||||
| 47 | sub table | ||||||||||||
| 48 | 1 | ▶ | { | ||||||||||
|
Subroutine
table: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||
| 49 | 1 | my $self = shift; | |||||||||||
| 50 | 1 | $self->{table}; | |||||||||||
| 51 | } | ||||||||||||
| 52 | |||||||||||||
| 53 | sub attrib | ||||||||||||
| 54 | 0 | ▶ | { | ||||||||||
|
Subroutine
attrib: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||||
| 55 | 0 | my $self = shift; | |||||||||||
| 56 | |||||||||||||
| 57 | 0 | warn $self->output; | |||||||||||
| 58 | 0 | warn keys %{$self->output}; | |||||||||||
| 59 | |||||||||||||
| 60 | 0 | ▶ | if (my $href = $self->output->{html}) { | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 61 | 0 | warn 'HRef ', $href; | |||||||||||
| 62 | 0 | $href->{attributes} = {}; | |||||||||||
| 63 | my $new_attributes = { | ||||||||||||
| 64 | 0 | %{$href->{attributes}}, | |||||||||||
| 65 | @_, | ||||||||||||
| 66 | }; | ||||||||||||
| 67 | 0 | $href->{attributes} = $new_attributes; | |||||||||||
| 68 | } | ||||||||||||
| 69 | |||||||||||||
| 70 | 0 | $self; | |||||||||||
| 71 | } | ||||||||||||
| 72 | |||||||||||||
| 73 | sub render | ||||||||||||
| 74 | 0 | ▶ | { | ||||||||||
|
Subroutine
render: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||
| 75 | 0 | my $self = shift; | |||||||||||
| 76 | 0 | $self->text; | |||||||||||
| 77 | } | ||||||||||||
| 78 | |||||||||||||
| 79 | 7 | 1; | |||||||||||
| 80 | __END__ | ||||||||||||