Class: Cmdlet::Inflection::Singularize
- Inherits:
-
BaseCmdlet
- Object
- BaseCmdlet
- Cmdlet::Inflection::Singularize
- Defined in:
- lib/cmdlet/inflection/singularize.rb
Overview
Singularize: The reverse of #pluralize, returns the singular form of a word in a string
Instance Method Summary collapse
-
#call(value) ⇒ String
Plural value turned to singular value.
Methods inherited from BaseCmdlet
Instance Method Details
#call(value) ⇒ String
Returns plural value turned to singular value.
11 12 13 14 15 16 17 |
# File 'lib/cmdlet/inflection/singularize.rb', line 11 def call(value) return '' if value.nil? value = value.to_s if value.is_a?(Symbol) value.singularize end |