Sha256: 15e2c7d848f6be8566b8b5027198eccf406103c0d54a2c33fa833808bc09621c

Contents?: true

Size: 176 Bytes

Versions: 1

Compression:

Stored size: 176 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

1 entries across 1 versions & 1 rubygems

Version Path
ppc-0.3.0 lib/ppc/ext.rb