Class: String
- Inherits:
-
Object
- Object
- String
- Defined in:
- lib/raketa_admin/sinatra_adapter.rb
Instance Method Summary collapse
Instance Method Details
#singularize ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/raketa_admin/sinatra_adapter.rb', line 7 def singularize return self if empty? case self when /(s|x|z|ch|sh)es$/ then self[0..-3] when /ies$/ then "#{self[0..-4]}y" when /ves$/ then "#{self[0..-4]}f" when /s$/ then self[0..-2] else self end end |