Sha256: 04ed2735734076abfce1c09228b4d967ec93327b0ce5209b7a87270376f42a49
Contents?: true
Size: 565 Bytes
Versions: 29
Compression:
Stored size: 565 Bytes
Contents
# frozen_string_literal: true module Cmdlet # Inflection handling routines, eg. pluralize, singular, ordinalize module Inflection # Singularize: The reverse of #pluralize, returns the singular form of a word in a string class Singularize < Cmdlet::BaseCmdlet # # @param [String] value - value - value to singularized # @return [String] plural value turned to singular value def call(value) return '' if value.nil? value = value.to_s if value.is_a?(Symbol) value.singularize end end end end
Version data entries
29 entries across 29 versions & 1 rubygems