Method: Treat::Autoload.singularize

Defined in:
lib/treat/autoload.rb

.singularize(w) ⇒ Object

Helper method to singularize words.



39
40
41
42
# File 'lib/treat/autoload.rb', line 39

def self.singularize(w)
  if w[-3..-1] == 'ies'; w[0..-4] +  'y'
  else; (w[-1] == 's' ? w[0..-2] : w); end
end