Module: Devlog::SevendaysTotal

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

Instance Method Summary collapse

Instance Method Details

#total_hoursObject



323
324
325
# File 'lib/devlog.rb', line 323

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

#total_hours_stringObject



327
328
329
330
331
332
333
# File 'lib/devlog.rb', line 327

def total_hours_string
  total = total_hours

  return "" if total <= 0

  "#{total}h"
end