Module: Topographer::Generators::Helpers

Included in:
Install
Defined in:
lib/topographer/generators/helpers.rb

Instance Method Summary collapse

Instance Method Details

#underscore_name(name) ⇒ Object



4
5
6
7
8
9
10
# File 'lib/topographer/generators/helpers.rb', line 4

def underscore_name(name)
  name.gsub(/::/, '/').
  gsub(/([A-Z]+)([A-Z][a-z])/,'\1_\2').
  gsub(/([a-z\d])([A-Z])/,'\1_\2').
  tr("-", "_").
  downcase
end