Class: String
- Inherits:
-
Object
- Object
- String
- Defined in:
- lib/cogbot/utils.rb
Overview
this is a monkey patching over the String class to bring the camelcase method from rails
Instance Method Summary collapse
-
#camelize ⇒ Object
the famous camelize method so useful in metaprogramming.
Instance Method Details
#camelize ⇒ Object
the famous camelize method so useful in metaprogramming
6 7 8 9 |
# File 'lib/cogbot/utils.rb', line 6 def camelize self.downcase! self.gsub!(/(?:_| )?(.)([^_ ]*)/) { "#{$1.upcase}#{$2}" } end |