Sha256: 9c823126a8a5cf46cabe6a5be09774576ad3c2da02e50c077020ea2adada4b05
Contents?: true
Size: 359 Bytes
Versions: 3
Compression:
Stored size: 359 Bytes
Contents
module Support module Inflector def self.titelize(name) name.gsub(/[^\w ]/, '') .gsub(/^[^a-zA-Z]+/, '') .gsub(/_/, ' ') .gsub(/ {2,}/, ' ') .gsub(/ +$/, '') .gsub(/^\w| \w/, &:upcase) end def self.modulize(name) name.split(/[\s_]+/).map(&:capitalize).join.to_sym end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
rail-0.1.1 | lib/support/inflector.rb |
rail-0.1.0 | lib/support/inflector.rb |
rail-0.0.8 | lib/support/inflector.rb |