Commit | Line | Data |
---|---|---|
d0eafc11 | 1 | package Excel::Template::Base; |
2 | ||
3 | use strict; | |
4 | ||
d0eafc11 | 5 | use Excel::Template::Factory; |
6 | ||
7 | sub new | |
8 | { | |
9 | my $class = shift; | |
d01e4722 | 10 | |
11 | push @_, %{shift @_} while ref $_[0] eq 'HASH'; | |
12 | (@_ % 2) | |
d0eafc11 | 13 | and die "$class->new() called with odd number of option parameters\n"; |
d01e4722 | 14 | |
d0eafc11 | 15 | my %x = @_; |
d01e4722 | 16 | |
d0eafc11 | 17 | # Do not use a hashref-slice here because of the uppercase'ing |
18 | my $self = {}; | |
19 | $self->{uc $_} = $x{$_} for keys %x; | |
d01e4722 | 20 | |
d0eafc11 | 21 | bless $self, $class; |
22 | } | |
d01e4722 | 23 | |
24 | *isa = *isa = \&Excel::Template::Factory::isa; | |
25 | *is_embedded = *is_embedded = \&Excel::Template::Factory::is_embedded; | |
d0eafc11 | 26 | |
e976988f | 27 | #sub calculate { ($_[1])->get(@_[0,2]) } |
d0eafc11 | 28 | #{ |
29 | # my $self = shift; | |
30 | # my ($context, $attr) = @_; | |
31 | # | |
32 | # return $context->get($self, $attr); | |
33 | #} | |
d01e4722 | 34 | |
d0eafc11 | 35 | sub enter_scope { ($_[1])->enter_scope($_[0]) } |
36 | #{ | |
37 | # my $self = shift; | |
38 | # my ($context) = @_; | |
39 | # | |
40 | # return $context->enter_scope($self); | |
41 | #} | |
d01e4722 | 42 | |
43 | sub exit_scope { ($_[1])->exit_scope($_[0], $_[2]) } | |
d0eafc11 | 44 | #{ |
45 | # my $self = shift; | |
46 | # my ($context, $no_delta) = @_; | |
47 | # | |
48 | # return $context->exit_scope($self, $no_delta); | |
49 | #} | |
d01e4722 | 50 | |
d0eafc11 | 51 | sub deltas |
52 | { | |
53 | # my $self = shift; | |
54 | # my ($context) = @_; | |
d01e4722 | 55 | |
d0eafc11 | 56 | return {}; |
57 | } | |
d01e4722 | 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 | #{ | |
d0eafc11 | 64 | # my $self = shift; |
65 | # my ($context) = @_; | |
d01e4722 | 66 | # |
67 | # ''; | |
68 | #} | |
69 | # | |
70 | #sub render | |
71 | #{ | |
d0eafc11 | 72 | # my $self = shift; |
73 | # my ($context) = @_; | |
d01e4722 | 74 | # |
75 | # 1; | |
76 | #} | |
d0eafc11 | 77 | |
78 | 1; | |
79 | __END__ | |
6dd4c89d | 80 | |
81 | =head1 NAME | |
82 | ||
83 | Excel::Template::Base - Excel::Template::Base | |
84 | ||
85 | =head1 PURPOSE | |
86 | ||
87 | Base class for all Excel::Template classes | |
88 | ||
89 | =head1 NODE NAME | |
90 | ||
91 | None | |
92 | ||
93 | =head1 INHERITANCE | |
94 | ||
95 | None | |
96 | ||
97 | =head1 ATTRIBUTES | |
98 | ||
99 | None | |
100 | ||
101 | =head1 CHILDREN | |
102 | ||
103 | None | |
104 | ||
105 | =head1 EFFECTS | |
106 | ||
107 | None | |
108 | ||
109 | =head1 DEPENDENCIES | |
110 | ||
111 | None | |
112 | ||
113 | =head1 METHODS | |
114 | ||
c11fa570 | 115 | =head2 calculate |
116 | ||
117 | This is a wrapper around Excel::Template::Context->get() | |
118 | ||
119 | =head2 isa | |
120 | ||
121 | This is a wrapper around Excel::Template::Factory->isa() | |
122 | ||
123 | =head2 is_embedded | |
124 | ||
125 | This is a wrapper around Excel::Template::Factory->is_embedded() | |
6dd4c89d | 126 | |
127 | =head1 AUTHOR | |
128 | ||
129 | Rob Kinyon (rob.kinyon@gmail.com) | |
130 | ||
131 | =head1 SEE ALSO | |
132 | ||
133 | =cut |