Sha256: 5088110056359f82934fbfc5c070fc6500f7c8d03ac884071133340c2e812908

Contents?: true

Size: 200 Bytes

Versions: 2

Compression:

Stored size: 200 Bytes

Contents

class String

  # Taken from Rails
  def underscore
    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

2 entries across 2 versions & 1 rubygems

Version Path
genomer-plugin-validate-0.0.2 lib/extensions/string.rb
genomer-plugin-validate-0.0.1 lib/extensions/string.rb