Module: Clerk::Utils
- Defined in:
- lib/clerk/utils.rb
Class Method Summary collapse
Class Method Details
.camelize(term) ⇒ Object
4 5 6 7 8 9 |
# File 'lib/clerk/utils.rb', line 4 def camelize(term) string = term.to_s string = string.sub(/^[a-z\d]*/) { match.capitalize } string.gsub!(/(?:_|(\/))([a-z\d]*)/) { "#{$1}#{$2.capitalize}" } string end |