Sha256: 585661a6d6bdb3e91bce35dc41b0dccef5e3868e73a725e4911f6eccf768974b

Contents?: true

Size: 214 Bytes

Versions: 1

Compression:

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

1 entries across 1 versions & 1 rubygems

Version Path
rulers_seanfred-0.0.2 lib/rulers/util.rb