Module: DeepCover::Tools::Camelize
Instance Method Summary collapse
-
#camelize(string) ⇒ Object
Poor man’s camelize.
Instance Method Details
#camelize(string) ⇒ Object
Poor man’s camelize. ‘an_example’ => ‘AnExample’
8 9 10 |
# File 'lib/deep_cover/tools/camelize.rb', line 8 def camelize(string) string.to_s.gsub(/([a-z\d]*)[_?!]?/) { Regexp.last_match(1).capitalize } end |