Method: TableView#to_s

Defined in:
lib/views.rb

#to_sObject



55
56
57
58
59
60
61
62
# File 'lib/views.rb', line 55

def to_s
  @map.map do |(key, count)|
    color = count > 0 ? GREEN : RED
    done = count > 0 ? "" : " "
    description = key.at_width(SCREEN_WIDTH - COUNT_CHARS_OFFSET - CHECKMARK_CHARS_OFFSET)
    [color, done, ' ', description, count.to_s.rjust(COUNT_CHARS_OFFSET), RESET].join
  end
end