Module: RuboCop::Formatter::TextUtil Private
- Included in:
- CLI::Command::ExecuteRunner, HTMLFormatter::ERBContext, MarkdownFormatter, PacmanFormatter, ProgressFormatter, SimpleTextFormatter::Report
- Defined in:
- lib/rubocop/formatter/text_util.rb
Overview
This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.
Common logic for UI texts.
Class Method Summary collapse
Class Method Details
permalink .pluralize(number, thing, options = {}) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
9 10 11 12 13 14 15 16 17 |
# 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 |