Initial Import
[p5sagit/Excel-Template.git] / lib / Excel / Template / Base.pm
1 package Excel::Template::Base;
2
3 use strict;
4
5 BEGIN {
6 }
7
8 use Excel::Template::Factory;
9
10 sub new
11 {
12     my $class = shift;
13                                                                                 
14     push @_, %{shift @_} while UNIVERSAL::isa($_[0], 'HASH');
15     (@_ % 2) 
16         and die "$class->new() called with odd number of option parameters\n";
17                                                                                 
18     my %x = @_;
19                                                                                 
20     # Do not use a hashref-slice here because of the uppercase'ing
21     my $self = {};
22     $self->{uc $_} = $x{$_} for keys %x;
23                                                                                 
24     bless $self, $class;
25 }
26                                                                                 
27 sub isa { Excel::Template::Factory::isa(@_) }
28
29 sub calculate { ($_[1])->get(@_[0,2]) }
30 #{
31 #    my $self = shift;
32 #    my ($context, $attr) = @_;
33 #
34 #    return $context->get($self, $attr);
35 #}
36                                                                                 
37 sub enter_scope { ($_[1])->enter_scope($_[0]) }
38 #{
39 #    my $self = shift;
40 #    my ($context) = @_;
41 #
42 #    return $context->enter_scope($self);
43 #}
44                                                                                 
45 sub exit_scope { ($_[1])->exit_scope(@_[0, 2]) }
46 #{
47 #    my $self = shift;
48 #    my ($context, $no_delta) = @_;
49 #
50 #    return $context->exit_scope($self, $no_delta);
51 #}
52                                                                                 
53 sub deltas
54 {
55 #    my $self = shift;
56 #    my ($context) = @_;
57                                                                                 
58     return {};
59 }
60                                                                                 
61 sub resolve
62 {
63 #    my $self = shift;
64 #    my ($context) = @_;
65                                                                                 
66     '';
67 }
68
69 sub render
70 {
71 #    my $self = shift;
72 #    my ($context) = @_;
73
74     1;
75 }
76
77 1;
78 __END__