summaryrefslogtreecommitdiffstats
path: root/lib/Spreadsheet/Template.pm
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2013-07-02 11:19:36 -0400
committerJesse Luehrs <doy@tozt.net>2013-07-02 11:22:21 -0400
commite99fa320ad6c3d3aa8b3a816a1ab4034a7f37247 (patch)
treedfa9b455e3e693f542db475c68cf7d7d201e1605 /lib/Spreadsheet/Template.pm
parentec35970711555786ce76d5d3de08fd3c61623188 (diff)
downloadspreadsheet-template-e99fa320ad6c3d3aa8b3a816a1ab4034a7f37247.tar.gz
spreadsheet-template-e99fa320ad6c3d3aa8b3a816a1ab4034a7f37247.zip
allow passing options to the backends
Diffstat (limited to 'lib/Spreadsheet/Template.pm')
-rw-r--r--lib/Spreadsheet/Template.pm16
1 files changed, 14 insertions, 2 deletions
diff --git a/lib/Spreadsheet/Template.pm b/lib/Spreadsheet/Template.pm
index 1000393..21e432c 100644
--- a/lib/Spreadsheet/Template.pm
+++ b/lib/Spreadsheet/Template.pm
@@ -11,12 +11,24 @@ has processor_class => (
default => 'Spreadsheet::Template::Processor::Xslate',
);
+has processor_options => (
+ is => 'ro',
+ isa => 'HashRef',
+ default => sub { {} },
+);
+
has writer_class => (
is => 'ro',
isa => 'Str',
default => 'Spreadsheet::Template::Writer::XLSX',
);
+has writer_options => (
+ is => 'ro',
+ isa => 'HashRef',
+ default => sub { {} },
+);
+
has processor => (
is => 'ro',
does => 'Spreadsheet::Template::Processor',
@@ -26,7 +38,7 @@ has processor => (
my $self = shift;
my $class = $self->processor_class;
load_class($class);
- return $class->new;
+ return $class->new($self->processor_options);
},
);
@@ -39,7 +51,7 @@ has writer => (
my $self = shift;
my $class = $self->writer_class;
load_class($class);
- return $class->new;
+ return $class->new($self->writer_options);
},
);