Sha256: 173fbb8dc50b0a69cc6f35fe8741359355ee969df80bf9b6f0f4daf843a1351d

Contents?: true

Size: 176 Bytes

Versions: 59

Compression:

Stored size: 176 Bytes

Contents

class String
  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

59 entries across 59 versions & 9 rubygems

Version Path
ipay-rails-1.0 lib/ipay/utilities/string.rb
alegra-0.4.1 lib/alegra/utilities/string.rb
myjohndeere-0.1.11 lib/myjohndeere/core_ext/string.rb
myjohndeere-0.1.10 lib/myjohndeere/core_ext/string.rb
myjohndeere-0.1.9 lib/myjohndeere/core_ext/string.rb
myjohndeere-0.1.8 lib/myjohndeere/core_ext/string.rb
myjohndeere-0.1.7 lib/myjohndeere/core_ext/string.rb
myjohndeere-0.1.6 lib/myjohndeere/core_ext/string.rb
myjohndeere-0.1.5 lib/myjohndeere/core_ext/string.rb
myjohndeere-0.1.4 lib/myjohndeere/core_ext/string.rb
myjohndeere-0.1.3 lib/myjohndeere/core_ext/string.rb
myjohndeere-0.1.2 lib/myjohndeere/core_ext/string.rb
myjohndeere-0.1.1 lib/myjohndeere/core_ext/string.rb
myjohndeere-0.1.0 lib/myjohndeere/core_ext/string.rb
myjohndeere-0.0.11 lib/myjohndeere/core_ext/string.rb
myjohndeere-0.0.10 lib/myjohndeere/core_ext/string.rb
myjohndeere-0.0.9 lib/myjohndeere/core_ext/string.rb
myjohndeere-0.0.8 lib/myjohndeere/core_ext/string.rb
myjohndeere-0.0.7 lib/myjohndeere/core_ext/string.rb
myjohndeere-0.0.6 lib/myjohndeere/core_ext/string.rb