# frozen_string_literal: true

module AggregateRoot
  class Transform
    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
  end
end
