Class: Updater
- Inherits:
-
Object
- Object
- Updater
- Includes:
- Utils
- Defined in:
- lib/konkit_worklogger/updater.rb
Instance Method Summary collapse
-
#initialize(configuration) ⇒ Updater
constructor
A new instance of Updater.
- #write(time) ⇒ Object
Methods included from Utils
#get_filename, #minutes_to_time
Constructor Details
#initialize(configuration) ⇒ Updater
Returns a new instance of Updater.
4 5 6 |
# File 'lib/konkit_worklogger/updater.rb', line 4 def initialize(configuration) @configuration = configuration end |
Instance Method Details
#write(time) ⇒ Object
8 9 10 11 12 13 14 |
# File 'lib/konkit_worklogger/updater.rb', line 8 def write(time) file_path = get_filename(@configuration, time.year, time.month, time.day) CSV.open(file_path, 'a+') do |csv| csv << [format('%d:%02d', time.hour, time.min)] end end |