Class: String
- Inherits:
-
Object
- Object
- String
- Defined in:
- lib/generators/entity_def/entity_def_generator.rb
Instance Method Summary collapse
Instance Method Details
#snake_case ⇒ Object
5 6 7 8 9 10 |
# File 'lib/generators/entity_def/entity_def_generator.rb', line 5 def snake_case return downcase if match(/\A[A-Z]+\z/) gsub(/([A-Z]+)([A-Z][a-z])/, '\1_\2'). gsub(/([a-z])([A-Z])/, '\1_\2'). downcase end |