class Handlebars::Helpers::StringFormatting::Singularize

The reverse of pluralize, returns the singular form of a word in a string

Public Instance Methods

parse(value) click to toggle source

Parse will reverse of pluralize, returns the singular form of a word in a string

@example

puts Singularize.new.parse('names')

name

puts Singularize.new.parse('octopi')

octopus

@return [String] plural value turned to singular value

# File lib/handlebars/helpers/string_formatting/singularize.rb, line 27
def parse(value)
  return '' if value.nil?

  value.singularize
end