Class: String
- Inherits:
-
Object
- Object
- String
- Defined in:
- lib/core_ext/string.rb,
lib/html5/filters/validator.rb
Instance Method Summary collapse
-
#underscore ⇒ Object
lifted from rails.
Instance Method Details
#underscore ⇒ Object
lifted from rails
24 25 26 27 28 29 30 |
# File 'lib/html5/filters/validator.rb', line 24 def underscore() self.gsub(/::/, '/'). gsub(/([A-Z]+)([A-Z][a-z])/,'\1_\2'). gsub(/([a-z\d])([A-Z])/,'\1_\2'). tr("-", "_"). downcase end |