Class: String
- Inherits:
-
Object
- Object
- String
- Defined in:
- lib/bot_mob/core_ext/string.rb
Overview
String - Core Extensions
Instance Method Summary collapse
Instance Method Details
#camelize ⇒ Object
3 4 5 6 7 |
# File 'lib/bot_mob/core_ext/string.rb', line 3 def camelize string = self string = string.sub(/^[a-z\d]*/) { $&.capitalize } string.gsub(/(?:_|(\/))([a-z\d]*)/) { "#{$1}#{$2.capitalize}" }.gsub('/', '::') end |