Class: AggregateRoot::Transform

Inherits:
Object
  • Object
show all
Defined in:
lib/aggregate_root/transform.rb

Class Method Summary collapse

Class Method Details

.to_snake_case(name) ⇒ Object



5
6
7
# File 'lib/aggregate_root/transform.rb', line 5

def self.to_snake_case(name)
  name.gsub(/([A-Z])([A-Z][a-z])/, '\1_\2').gsub(/([a-z\d])([A-Z])/, '\1_\2').downcase
end