Module: Reading::Stats::ResultFormatters

Defined in:
lib/reading/stats/terminal_result_formatters.rb

Constant Summary collapse

TERMINAL =
{
  average_length: ->(result) { length_to_s(result) },
  average_amount: ->(result) { length_to_s(result) },
  :'average_daily-amount' => ->(result) { "#{length_to_s(result)} per day" },
  total_item: ->(result) {
    if result.zero?
      PASTEL.bright_black("none")
    else
      color("#{result} #{result == 1 ? "item" : "items"}")
    end
  },
  total_amount: ->(result) { length_to_s(result) },
  top_length: ->(result) { top_or_bottom_lengths(result) },
  top_amount: ->(result) { top_or_bottom_lengths(result) },
  top_speed: ->(result) { top_or_bottom_speeds(result) },
  bottom_length: ->(result) { top_or_bottom_lengths(result) },
  botom_amount: ->(result) { top_or_bottom_lengths(result) },
  bottom_speed: ->(result) { top_or_bottom_speeds(result) },
}