Method: Animoto::Support::String#underscore
- Defined in:
- lib/animoto/support/string.rb
#underscore ⇒ String
Transforms this string from camel case to underscore-form. Downcases the entire string.
23 24 25 |
# File 'lib/animoto/support/string.rb', line 23 def underscore self.gsub(/([A-Z]+)([A-Z][a-z])/,'\1_\2').gsub(/([a-z\d])([A-Z])/,'\1_\2').downcase end |