Class: Cmdlet::Inflection::PluralizeNumberWord

Inherits:
BaseCmdlet
  • Object
show all
Defined in:
lib/cmdlet/inflection/pluralize_number_word.rb

Overview

PluralizeNumberWord: Returns the plural form of the word based on a count with the count prefixed in the format "3 categories"

Instance Method Summary collapse

Methods inherited from BaseCmdlet

#tokenizer

Instance Method Details

#call(value, count) ⇒ String



12
13
14
15
16
17
18
# File 'lib/cmdlet/inflection/pluralize_number_word.rb', line 12

def call(value, count)
  return '' if value.nil?

  count = count.to_i if count.is_a? String

  "#{count} #{value.pluralize(count)}"
end