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
myjohndeere-0.0.5 lib/myjohndeere/core_ext/string.rb
myjohndeere-0.0.4 lib/myjohndeere/core_ext/string.rb
myjohndeere-0.0.3 lib/myjohndeere/core_ext/string.rb
myjohndeere-0.0.2 lib/myjohndeere/core_ext/string.rb
myjohndeere-0.0.1 lib/myjohndeere/core_ext/string.rb
alegra-0.1.2.3 lib/alegra/utilities/string.rb
alegra-0.1.2.2 lib/alegra/utilities/string.rb
alegra-0.1.2.1 lib/alegra/utilities/string.rb
alegra-0.1.2 lib/alegra/utilities/string.rb
apple_vpp-3.1.2 lib/core_ext/string.rb
apple_vpp-3.1.1 lib/core_ext/string.rb
apple_vpp-3.1.0 lib/core_ext/string.rb
apple_vpp-3.0.2 lib/core_ext/string.rb
apple_vpp-3.0.1 lib/core_ext/string.rb
apple_vpp-3.0.0 lib/core_ext/string.rb
apple_vpp-2.1.0 lib/core_ext/string.rb
civic_aide-0.1.1 lib/civic_aide/string.rb
civic_aide-0.1.0 lib/civic_aide/string.rb
civic_aide-0.0.3 lib/civic_aide/string.rb
civic_aide-0.0.2 lib/civic_aide/string.rb