123456789_123456789_123456789_123456789_123456789_

Module: RuboCop::Formatter::TextUtil

Overview

Common logic for UI texts.

Class Method Summary

Class Method Details

.pluralize(number, thing, options = {}) (mod_func)

[ GitHub ]

  
# File 'lib/rubocop/formatter/text_util.rb', line 9

def pluralize(number, thing, options = {})
  if number.zero? && options[:no_for_zero]
    "no #{thing}s"
  elsif number == 1
    "1 #{thing}"
  else
    "#{number} #{thing}s"
  end
end