Sha256: 3ac313444b6a696a2f1a251d367050ee521bca4fe5a67602e5a0f6486e7e23d0
Contents?: true
Size: 259 Bytes
Versions: 15
Compression:
Stored size: 259 Bytes
Contents
# frozen_string_literal: true class String def camel split('_').map { |w| w[0].upcase + w[1..-1] }.join end def snake gsub(/([A-Z]+)([A-Z][a-z])/, '\1_\2') .gsub(/([a-z\d])([A-Z])/, '\1_\2') .tr('-', '_') .downcase end end
Version data entries
15 entries across 15 versions & 2 rubygems