ruboto/ruboto

View on GitHub
lib/ruboto/core_ext/object.rb

Summary

Maintainability
A
0 mins
Test Coverage
class Object
  # active_support/inflector.rb
  def underscore(camel_cased_word)
    camel_cased_word.to_s.gsub(/::/, '/').
    gsub(/([A-Z]+)([A-Z][a-z])/,'\1_\2').
    gsub(/([a-z\d])([A-Z])/,'\1_\2').
    tr("-", "_").
    downcase
  end
end