Method: String#underscore
- Defined in:
- lib/yard/core_ext/string.rb
#underscore ⇒ String
Separates capital letters following lower case letters by an underscore and returns the entire string in lower case
9 10 11 |
# File 'lib/yard/core_ext/string.rb', line 9 def underscore gsub(/([a-z])([A-Z])/, '\1_\2').downcase.gsub('::', '/') end |