Class: Cmdlet::Inflection::PluralizeNumber

Inherits:
BaseCmdlet
  • Object
show all
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

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.rb', line 12

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

  count = count.to_i if count.is_a? String

  value.pluralize(count)
end