Commit | Line | Data |
d0eafc11 |
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(@_) } |
37513eae |
28 | sub is_embedded { Excel::Template::Factory::is_embedded(@_) } |
d0eafc11 |
29 | |
30 | sub calculate { ($_[1])->get(@_[0,2]) } |
31 | #{ |
32 | # my $self = shift; |
33 | # my ($context, $attr) = @_; |
34 | # |
35 | # return $context->get($self, $attr); |
36 | #} |
37 | |
38 | sub enter_scope { ($_[1])->enter_scope($_[0]) } |
39 | #{ |
40 | # my $self = shift; |
41 | # my ($context) = @_; |
42 | # |
43 | # return $context->enter_scope($self); |
44 | #} |
45 | |
46 | sub exit_scope { ($_[1])->exit_scope(@_[0, 2]) } |
47 | #{ |
48 | # my $self = shift; |
49 | # my ($context, $no_delta) = @_; |
50 | # |
51 | # return $context->exit_scope($self, $no_delta); |
52 | #} |
53 | |
54 | sub deltas |
55 | { |
56 | # my $self = shift; |
57 | # my ($context) = @_; |
58 | |
59 | return {}; |
60 | } |
61 | |
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__ |