Sha256: 4b2b25616eb984b97b2bb88196a6b7a450e9f2f76fae43818ba10359d5dcd3d0

Contents?: true

Size: 177 Bytes

Versions: 6

Compression:

Stored size: 177 Bytes

Contents

class String
  def snake_case
    self.gsub(/::/, '/').
    gsub(/([A-Z]+)([A-Z][a-z])/,'\1_\2').
    gsub(/([a-z\d])([A-Z])/,'\1_\2').
    tr("-", "_").
    downcase
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
ppc-2.0.5 lib/ppc/ext.rb
ppc-2.0.4 lib/ppc/ext.rb
ppc-2.0.3 lib/ppc/ext.rb
ppc-2.0.2 lib/ppc/ext.rb
ppc-2.0.1 lib/ppc/ext.rb
ppc-2.0.0 lib/ppc/ext.rb