Sha256: 56c5ba75d60d52de269a7b02d2434e5c9ffd859d138baf09520f2c430f6f0ca7
Contents?: true
Size: 305 Bytes
Versions: 9
Compression:
Stored size: 305 Bytes
Contents
class String # taken from active-support def underscore gsub(/::/, '/'). gsub(/([A-Z]+)([A-Z][a-z])/,'\1_\2'). gsub(/([a-z\d])([A-Z])/,'\1_\2'). tr("-", "_"). downcase end def camelize gsub(/\/(.?)/) { "::#{$1.upcase}" }.gsub(/(?:^|_)(.)/) { $1.upcase } end end
Version data entries
9 entries across 9 versions & 2 rubygems