Class: Cmdlet::Inflection::PluralizeNumberWord
- Inherits:
-
BaseCmdlet
- Object
- BaseCmdlet
- Cmdlet::Inflection::PluralizeNumberWord
- 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
-
#call(value, count) ⇒ String
Value and number are used to calculate plural/singular form.
Methods inherited from BaseCmdlet
Instance Method Details
#call(value, count) ⇒ String
Returns value and number are used to calculate plural/singular form.
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 |