Class: Cmdlet::Inflection::PluralizeNumber
- Inherits:
-
BaseCmdlet
- Object
- BaseCmdlet
- Cmdlet::Inflection::PluralizeNumber
- Defined in:
- lib/cmdlet/inflection/pluralize_number.rb
Overview
PluralizeNumber: Returns the plural form of the word based on a count in the format "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.rb', line 12 def call(value, count) return '' if value.nil? count = count.to_i if count.is_a? String value.pluralize(count) end |