Sha256: 3217d2b3aa6ce32adc8bd5942298f05a889f0376aaad89747cbfad748f37f7c3

Contents?: true

Size: 196 Bytes

Versions: 2

Compression:

Stored size: 196 Bytes

Contents

module Rulers
  def self.to_underscore(string)
    string.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
erik_rulers-0.0.5 lib/rulers/util.rb
erik_rulers-0.0.4 lib/rulers/util.rb