Class: String
- Inherits:
-
Object
- Object
- String
- Defined in:
- lib/webby/utils.rb
Instance Method Summary collapse
Instance Method Details
#underscore ⇒ Object
37 38 39 40 41 42 43 |
# File 'lib/webby/utils.rb', line 37 def underscore self. gsub(/([A-Z]+)([A-Z][a-z])/,'\1_\2'). gsub(/([a-z\d])([A-Z])/,'\1_\2'). tr(" -", "__"). downcase end |