Improved tests and documentation. Fixed a few bugs in register()
[p5sagit/Excel-Template.git] / lib / Excel / Template / Base.pm
index 9788c11..fe76002 100644 (file)
@@ -11,7 +11,7 @@ sub new
 {
     my $class = shift;
                                                                                 
-    push @_, %{shift @_} while UNIVERSAL::isa($_[0], 'HASH');
+    push @_, %{shift @_} while defined $_[0] && UNIVERSAL::isa($_[0], 'HASH');
     (@_ % 2) 
         and die "$class->new() called with odd number of option parameters\n";
                                                                                 
@@ -25,8 +25,9 @@ sub new
 }
                                                                                 
 sub isa { Excel::Template::Factory::isa(@_) }
+sub is_embedded { Excel::Template::Factory::is_embedded(@_) }
 
-sub calculate { ($_[1])->get(@_[0,2]) }
+#sub calculate { ($_[1])->get(@_[0,2]) }
 #{
 #    my $self = shift;
 #    my ($context, $attr) = @_;
@@ -76,3 +77,57 @@ sub render
 
 1;
 __END__
+
+=head1 NAME
+
+Excel::Template::Base - Excel::Template::Base
+
+=head1 PURPOSE
+
+Base class for all Excel::Template classes
+
+=head1 NODE NAME
+
+None
+
+=head1 INHERITANCE
+
+None
+
+=head1 ATTRIBUTES
+
+None
+
+=head1 CHILDREN
+
+None
+
+=head1 EFFECTS
+
+None
+
+=head1 DEPENDENCIES
+
+None
+
+=head1 METHODS
+
+=head2 calculate
+
+This is a wrapper around Excel::Template::Context->get()
+
+=head2 isa
+
+This is a wrapper around Excel::Template::Factory->isa()
+
+=head2 is_embedded
+
+This is a wrapper around Excel::Template::Factory->is_embedded()
+
+=head1 AUTHOR
+
+Rob Kinyon (rob.kinyon@gmail.com)
+
+=head1 SEE ALSO
+
+=cut