Method: String#__camelize
- Defined in:
- lib/vmopt/ext/string_ext.rb
#__camelize(first_letter_in_uppercase = true) ⇒ Object Also known as: camelize
66 67 68 69 70 71 72 |
# File 'lib/vmopt/ext/string_ext.rb', line 66 def __camelize(first_letter_in_uppercase=true) if first_letter_in_uppercase self.to_s.gsub(/\/(.?)/) { "::#{$1.upcase}" }.gsub(/(?:^|_)(.)/) { $1.upcase } else self.to_s[0].chr.downcase + camelize(self)[1..-1] end end |