Module: Devlog::SevendaysTotal

Included in:
Day, Sevendays
Defined in:
lib/devlog.rb

Instance Method Summary collapse

Instance Method Details

#total_hoursObject



329
330
331
# File 'lib/devlog.rb', line 329

def total_hours
  ((all.inject(0) { |time, zezzion| time + zezzion.session_time }) / 60 / 60).round(2)
end

#total_hours_stringObject



333
334
335
336
337
338
339
# File 'lib/devlog.rb', line 333

def total_hours_string
  total = total_hours

  return "" if total <= 0

  "#{total} [h]"
end