Sha256: b990a583b2de7b4049cf106b00e5fa80d4253ba6a23226fd0d57e63629c4af0f
Contents?: true
Size: 319 Bytes
Versions: 10
Compression:
Stored size: 319 Bytes
Contents
class Util def self.underscore(term) # taken from ActiveSupport term.gsub!(/::/, '/') term.gsub!(/([A-Z]+)([A-Z][a-z])/, '\1_\2') term.gsub!(/([a-z\d])([A-Z])/, '\1_\2') term.tr!('-', '_') term.downcase end def self.classify(term) term.split('_').collect(&:capitalize).join end end
Version data entries
10 entries across 10 versions & 2 rubygems