Commit | Line | Data |
---|---|---|
b6bc5a5d | 1 | package Spreadsheet::WriteExcel; |
2 | ||
3 | use strict; | |
4 | ||
5 | use mock; | |
6 | use Spreadsheet::WriteExcel::Worksheet; | |
7 | ||
8 | sub new { | |
9 | my $self = bless { | |
10 | }, shift; | |
11 | ||
12 | { | |
13 | local $" = "', '"; | |
9d172425 | 14 | push @mock::calls, ref($self) . "::new( '@_' )"; |
b6bc5a5d | 15 | } |
16 | ||
17 | return $self; | |
18 | } | |
19 | ||
20 | sub close { | |
9d172425 | 21 | my $self = shift; |
b6bc5a5d | 22 | { |
23 | local $" = "', '"; | |
9d172425 | 24 | push @mock::calls, ref($self) . "::close( '@_' )"; |
b6bc5a5d | 25 | } |
26 | } | |
27 | ||
28 | sub add_worksheet { | |
9d172425 | 29 | my $self = shift; |
b6bc5a5d | 30 | { |
31 | local $" = "', '"; | |
9d172425 | 32 | push @mock::calls, ref($self) . "::add_worksheet( '@_' )"; |
b6bc5a5d | 33 | } |
34 | return Spreadsheet::WriteExcel::Worksheet->new; | |
35 | } | |
36 | ||
37 | my $format_num = 1; | |
38 | sub add_format { | |
9d172425 | 39 | my $self = shift; |
b6bc5a5d | 40 | my %x = @_; |
41 | my @x = map { $_ => $x{$_} } sort keys %x; | |
42 | { | |
43 | local $" = "', '"; | |
9d172425 | 44 | push @mock::calls, ref($self) . "::add_format( '@x' )"; |
b6bc5a5d | 45 | } |
46 | return $format_num++; | |
47 | } | |
48 | ||
49 | 1; | |
50 | __END__ |