Module: RuboCop::Formatter::TextUtil
Relationships & Source Files | |
Extension / Inclusion / Inheritance Descendants | |
Included In:
| |
Defined in: | lib/rubocop/formatter/text_util.rb |
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, = {}) if number.zero? && [:no_for_zero] "no #{thing}s" elsif number == 1 "1 #{thing}" else "#{number} #{thing}s" end end