NAME
App::TimeClock::Daily::Report
DESCRIPTION
Can parse the timelog and generate a report using an instance of a App::TimeClock::Daily::PrinterInterface.
METHODS
- new($timelog, $printer)
-
Initializes a new App::TimeClock::Daily::Report object.
Two parameters are required:
- $timelog
-
Must point to a timelog file. Will die if not.
- $printer
-
An object derived from App::TimeClock::Daily::PrinterInterface. Will die if not.
- _timelocal()
-
Returns a time (seconds since epoch) from a date and time.
- _get_report_time()
-
Returns the time when the report was executed.
- _set_report_time()
-
Sets the time when the report is executed.
Two parameters are required:
- _read_lines()
-
Reads a set of check in and check out lines.
If end of file is reached after reading the check in line, then reading of the check out line is skipped.
- _parse_lines()
-
Parses a set of check in and check out lines.
The lines are split on space and should contain the following four fields:
- state
-
is either 'i' - check in or 'o' - check out.
- date
-
is formatted as YYYY/MM//DD
- time
-
is formatted as HH:MM:SS
- project
-
is then name of the project/task and is only required when checking in.
- execute()
-
Opens the timelog file starts parsing it, looping over each day and calling print_day() for each.
AUTHOR
Søren Lund, <soren at lund.org>
SEE ALSO
COPYRIGHT
Copyright (C) 2012-2015 Søren Lund
This file is part of App::TimeClock.
App::TimeClock is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
App::TimeClock 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. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with App::TimeClock. If not, see <http://www.gnu.org/licenses/>.