File Coverage

blib/lib/Excel/Template/Base.pm
Criterion Covered Total %
statement 13 17 76.4
branch 1 2 50.0
condition n/a
subroutine 3 6 50.0
pod 0 4 0.0
total 17 29 58.6


line stmt bran cond sub pod time code
1             package Excel::Template::Base;
2              
3 29     29   153 use strict;
  29         39  
  29         794  
4              
5 29     29   11217 use Excel::Template::Factory;
  29         75  
  29         6934  
6              
7             sub new
8             {
9 28     28 0 34192 my $class = shift;
10              
11 28         136 push @_, %{shift @_} while ref $_[0] eq 'HASH';
  0         0  
12 28 50       120 (@_ % 2)
13             and die "$class->new() called with odd number of option parameters\n";
14              
15 28         102 my %x = @_;
16              
17             # Do not use a hashref-slice here because of the uppercase'ing
18 28         50 my $self = {};
19 28         163 $self->{uc $_} = $x{$_} for keys %x;
20              
21 28         141 bless $self, $class;
22             }
23              
24             *isa = *isa = \&Excel::Template::Factory::isa;
25             *is_embedded = *is_embedded = \&Excel::Template::Factory::is_embedded;
26              
27             #sub calculate { ($_[1])->get(@_[0,2]) }
28             #{
29             # my $self = shift;
30             # my ($context, $attr) = @_;
31             #
32             # return $context->get($self, $attr);
33             #}
34              
35 0     0 0   sub enter_scope { ($_[1])->enter_scope($_[0]) }
36             #{
37             # my $self = shift;
38             # my ($context) = @_;
39             #
40             # return $context->enter_scope($self);
41             #}
42              
43 0     0 0   sub exit_scope { ($_[1])->exit_scope($_[0], $_[2]) }
44             #{
45             # my $self = shift;
46             # my ($context, $no_delta) = @_;
47             #
48             # return $context->exit_scope($self, $no_delta);
49             #}
50              
51             sub deltas
52             {
53             # my $self = shift;
54             # my ($context) = @_;
55              
56 0     0 0   return {};
57             }
58              
59             # Everyone seems to have their own versions.
60             # Maybe, it's part of the API to require that you have the right one of these
61             # defined?
62             #sub resolve
63             #{
64             # my $self = shift;
65             # my ($context) = @_;
66             #
67             # '';
68             #}
69             #
70             #sub render
71             #{
72             # my $self = shift;
73             # my ($context) = @_;
74             #
75             # 1;
76             #}
77              
78             1;
79             __END__