Class: Hubspot::Helpers::SnakeCase
- Inherits:
-
Object
- Object
- Hubspot::Helpers::SnakeCase
- Defined in:
- lib/hubspot/helpers/snake_case.rb
Instance Method Summary collapse
Instance Method Details
#format(string) ⇒ Object
4 5 6 7 8 9 10 11 |
# File 'lib/hubspot/helpers/snake_case.rb', line 4 def format(string) string.gsub('OAuth', 'Oauth'). gsub(/::/, '/'). gsub(/([A-Z]+)([A-Z][a-z])/,'\1_\2'). gsub(/([a-z\d])([A-Z])/,'\1_\2'). tr("-", "_"). downcase end |