Class: String
- Inherits:
-
Object
- Object
- String
- Defined in:
- lib/machineshop/util.rb
Instance Method Summary collapse
Instance Method Details
#underscore ⇒ Object
186 187 188 189 190 191 192 |
# File 'lib/machineshop/util.rb', line 186 def underscore self.gsub(/::/, '/'). gsub(/([A-Z]+)([A-Z][a-z])/,'\1_\2'). gsub(/([a-z\d])([A-Z])/,'\1_\2'). tr("-", "_"). downcase end |