Sha256: 61d10fe44f2def81e8ef7f6e811ea104cff8db32a479d70a6724b70a1fdbc59d
Contents?: true
Size: 357 Bytes
Versions: 13
Compression:
Stored size: 357 Bytes
Contents
module Magent module Utils def self.underscore(word) word.to_s.gsub(/::/, '.'). gsub(/([A-Z]+)([A-Z][a-z])/,'\1_\2'). gsub(/([a-z\d])([A-Z])/,'\1_\2').tr("-", "_").downcase end def self.camelize(word) word.to_s.gsub(/\.(.?)/) { "::#{$1.upcase}" }.gsub(/(?:^|_)(.)/) { $1.upcase } end end end
Version data entries
13 entries across 13 versions & 2 rubygems