def underscore(str)
      return '' if str.empty?

      str = str.gsub('::', '/')
      str.gsub!(/([A-Z]+)([A-Z][a-z])/, '\1_\2')
      str.gsub!(/([a-z\d])([A-Z])/, '\1_\2')
      str.downcase!
      str
    end
def underscore(str)
      return '' if str.empty?

      str = str.gsub('::', '/')
      str.gsub!(/([A-Z]+)([A-Z][a-z])/, '\1_\2')
      str.gsub!(/([a-z\d])([A-Z])/, '\1_\2')
      str.downcase!
      str
    end
Convert input into snake-case.

 This method also converts +'::'+ to +'/'+.

 @param [String] str
   String to be converted.

 @return [String]
   Converted string.

 @example
   Util.underscore('MemoryIO')
   #=> 'memory_io'

   Util.underscore('MyModule::MyClass')
   #=> 'my_module/my_class'