Sha256: b61b73b057e7e264a3a744ac2e2a170ab74a4b2af36c0a076d2381e9742ba430

Contents?: true

Size: 195 Bytes

Versions: 4

Compression:

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

4 entries across 4 versions & 1 rubygems

Version Path
arli-0.8.3 lib/arli/extensions.rb
arli-0.7.0 lib/arli/extensions.rb
arli-0.6.2 lib/arli/extensions.rb
arli-0.6.1 lib/arli/extensions.rb