From a33c58b52d1b9331635a600aa79344a7a3e0a748 Mon Sep 17 00:00:00 2001 From: Thadeu Lima de Souza Cascardo Date: Sat, 31 Oct 2015 23:31:03 -0200 Subject: [PATCH] Document class in POD --- lib/Finance/Bank/BR/Santander/Spreadsheet.pm | 89 +++++++++++++++++--- 1 file changed, 75 insertions(+), 14 deletions(-) diff --git a/lib/Finance/Bank/BR/Santander/Spreadsheet.pm b/lib/Finance/Bank/BR/Santander/Spreadsheet.pm index c48062b..e4bddb6 100644 --- a/lib/Finance/Bank/BR/Santander/Spreadsheet.pm +++ b/lib/Finance/Bank/BR/Santander/Spreadsheet.pm @@ -3,20 +3,6 @@ package Finance::Bank::BR::Santander::Spreadsheet; use strict; use warnings; -=head1 COPYRIGHT AND LICENSE - - Copyright (C) 2015 Thadeu Lima de Souza Cascardo - - This program is free software; you can redistribute it and/or modify it under - the terms of the GNU General Public License; either version 2 of the License, - or (at your option) any later version. - - This program is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - FOR A PARTICULAR PURPOSE. - -=cut - use Spreadsheet::ParseExcel::Simple; use DateTime::Format::Strptime qw(strptime); @@ -83,3 +69,78 @@ sub statement { } 1; + +__END__ + +=head1 NAME + +Finance::Bank::BR::Santander::Spreadsheet - Parse statement exported from Brazilian branch of Santander Internet Banking + +=head1 SYNOPSIS + + use Finance::Bank::BR::Santander::Spreadsheet; + + my $spreadsheet = Finance::Bank::BR::Santander::Spreadsheet->new($filename); + my $balance = $spreadsheet->balance; + my $data = $spreadsheet->statement; + foreach my $transaction (@{$data}) { + say "$transaction->{date}, $transaction->{name}, $transaction->{extra}, $transaction->{value}, $transaction->{balance}"; + } + +=head1 Description + +This module is an object-oriented interface that parses statements exported as XLS from the Internet Banking for the Brazilian branch of Santander. + +=head1 Spreadsheet + +=head2 new($filename) + +The C method creates a new Spreadsheet object containing the data parsed from C<$filename>. + +If an error occurs while loading the file, C returns C. + +=head2 balance() + +The C method returns the last balance found in the sheet. + +=head2 statement() + +The C method returns a reference to an array of transactions, described as below. + +=head1 Transaction + +The transaction is a hash containing the following keys: + +=head2 name + +A string with a name describing the transaction. + +=head2 value + +A floating number containing the credit (positive) or debit (negative) of the transaction. + +=head2 date + +A DateTime object representing the date when the transaction occurred. + +=head2 balance + +A floating number containing the balance resulting from the transaction. + +=head2 extra + +Data provided by the bank identifying the transaction. In this case, a number specific to the type of transaction. It can be used to help uniquely identify the transaction. + +=head1 COPYRIGHT AND LICENSE + + Copyright (C) 2015 Thadeu Lima de Souza Cascardo + + This program is free software; you can redistribute it and/or modify it under + the terms of the GNU General Public License; either version 2 of the License, + or (at your option) any later version. + + This program is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + FOR A PARTICULAR PURPOSE. + +=cut -- 2.20.1