Sha256: b6e52f35862fda5bb4b6df067c8116983dd7d1970dc7a5c21e9068b54b1e849f
Contents?: true
Size: 409 Bytes
Versions: 8
Compression:
Stored size: 409 Bytes
Contents
module TensorStream module StringHelper def camelize(string, uppercase_first_letter = true) string = if uppercase_first_letter string.sub(/^[a-z\d]*/) { $&.capitalize } else string.sub(/^(?:(?=\b|[A-Z_])|\w)/) { $&.downcase } end string.gsub(/(?:_|(\/))([a-z\d]*)/) { "#{$1}#{$2.capitalize}" }.gsub('/', '::') end end end
Version data entries
8 entries across 8 versions & 1 rubygems