Class: Handlebars::Helpers::StringFormatting::Singularize
- Inherits:
-
BaseHelper
- Object
- BaseHelper
- Handlebars::Helpers::StringFormatting::Singularize
- Defined in:
- lib/handlebars/helpers/string_formatting/singularize.rb
Overview
The reverse of #pluralize, returns the singular form of a word in a string
Instance Method Summary collapse
-
#parse(value) ⇒ String
Parse will reverse of #pluralize, returns the singular form of a word in a string.
Methods inherited from BaseHelper
#handlebars_helper, #parse_json, #struct_to_hash, #tokenizer, #wrapper
Instance Method Details
#parse(value) ⇒ String
Parse will reverse of #pluralize, returns the singular form of a word in a string
27 28 29 30 31 |
# File 'lib/handlebars/helpers/string_formatting/singularize.rb', line 27 def parse(value) return '' if value.nil? value.singularize end |