Class: String
- Inherits:
-
Object
- Object
- String
- Defined in:
- lib/smallcage/misc.rb
Overview
From active-support/inflector.rb
Instance Method Summary collapse
Instance Method Details
#camelize(first_letter_in_uppercase = true) ⇒ Object
4 5 6 7 8 9 10 11 |
# File 'lib/smallcage/misc.rb', line 4 def camelize(first_letter_in_uppercase = true) s = self if first_letter_in_uppercase s.gsub(/\/(.?)/) { '::' + $1.upcase }.gsub(/(^|_)(.)/) { $2.upcase } else s[0..0] + s.camelize[1..-1] end end |