Class: DaySummaryPrinter
- Inherits:
-
Object
- Object
- DaySummaryPrinter
- Defined in:
- lib/konkit_worklogger/printer.rb
Instance Method Summary collapse
-
#initialize(configuration) ⇒ DaySummaryPrinter
constructor
A new instance of DaySummaryPrinter.
- #print(year, month, day) ⇒ Object
Constructor Details
#initialize(configuration) ⇒ DaySummaryPrinter
Returns a new instance of DaySummaryPrinter.
2 3 4 |
# File 'lib/konkit_worklogger/printer.rb', line 2 def initialize(configuration) @configuration = configuration end |
Instance Method Details
#print(year, month, day) ⇒ Object
6 7 8 9 10 11 |
# File 'lib/konkit_worklogger/printer.rb', line 6 def print(year, month, day) entry = DayEntryLoader.new(@configuration).load_from_file(year, month, day) date_string = format('%d-%02d-%02d', year, month, day) puts format('%s: %s - %s (%s)', date_string, entry.start_time, entry.end_time, entry.time_today) end |