Class: String
- Inherits:
-
Object
- Object
- String
- Defined in:
- lib/ext/string.rb
Instance Method Summary collapse
-
#classify ⇒ Object
Turns a lower_case_underscored_name into an UpperCaseCamelCaseName.
Instance Method Details
#classify ⇒ Object
Turns a lower_case_underscored_name into an UpperCaseCamelCaseName
3 4 5 |
# File 'lib/ext/string.rb', line 3 def classify self.gsub("_", " ").gsub(/\b('?[a-z])/) { $1.capitalize }.gsub(" ", "") end |