module RuboCop::Formatter::TextUtil
Common logic for UI texts.
Public Instance Methods
pluralize(number, thing, options = {})
click to toggle source
# File lib/rubocop/formatter/text_util.rb, line 8 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