Class: DaySummaryPrinter

Inherits:
Object
  • Object
show all
Defined in:
lib/konkit_worklogger/printer.rb

Instance Method Summary collapse

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



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