Sha256: 4b392c9df46465a9497e9b42dfd74b50f558d9aa53d97e0396ef222b3b6a40f4
Contents?: true
Size: 685 Bytes
Versions: 24
Compression:
Stored size: 685 Bytes
Contents
# frozen_string_literal: true module Cmdlet # Inflection handling routines, eg. pluralize, singular, ordinalize module Inflection # PluralizeNumber: Returns the plural form of the word based on a count in the format "categories" class PluralizeNumber < Cmdlet::BaseCmdlet # # @param [String] value - value - value to pluralize # @param [Int] count - count used to determine pluralization # @return [String] value and number are used to calculate plural/singular form def call(value, count) return '' if value.nil? count = count.to_i if count.is_a? String value.pluralize(count) end end end end
Version data entries
24 entries across 24 versions & 1 rubygems