Sha256: 8a339473de0a6185353854a410ed71a568cf80a9f74dab1e663758a17f14039c
Contents?: true
Size: 369 Bytes
Versions: 4
Compression:
Stored size: 369 Bytes
Contents
# frozen_string_literal: true module AsyncStorage module Util module Strings module_function def underscore(string, module_sep = '/') string .gsub(/::/, module_sep) .gsub(/([A-Z]+)([A-Z][a-z])/, '\1_\2') .gsub(/([a-z\d])([A-Z])/, '\1_\2') .tr('-', '_') .downcase end end end end
Version data entries
4 entries across 4 versions & 1 rubygems